Giter Site home page Giter Site logo

vgs-docker's People

Contributors

adubeniuk avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

vgs-docker's Issues

Possible improvements

As there's no limit to perfection there are few thigns here which could be improved.

  1. use Ansible to generate rsyslog and nginx configs from jinja2 templates
    this will make the configs highly customizable and easily managed

  2. use Ansible dynamic inventory and Ansible docker module instead of docker-compose to run (and scale) the containers
    https://divhide.com/2016/05/10/using-a-docker-connection-with-ansible/

  3. use Docker Machine to provision on multiple Docker hosts via various cloud drivers such as AWS, GCP or DigitalOcean
    this will allow to make this setup really production ready and be able to test that on a local machine with VirtualBox as one of the supported drivers

and last but not least

  1. abandon rsyslog in favor of the native Docker supported logging drivers

Define nginx container logging approach

There could be multiple ways to get the logs from nginx to the logging agent in the container environment.

As this is quite an important decision I would like to describe some of the available options:

  • use nginx built-in syslog module to forward logs to the remote syslog
  • use docker built-in syslog logging driver to forward logs to the remote syslog
  • mount /var/log/nginx as docker data volume and attach that volume to the logging agent container

First option is the easiest to implement but it could also have the worst consequences.
By its design nginx will simply freeze when unable to write its logs in this case over syslog.

Second option seems rational as it will also allow us to get the logs from the Docker host itself.
Also it allows us to change logging driver from syslog to any other supported logging driver including fluentd.

However none of these two options require separate logging container.
Indeed we could forward the logs directly to the centralized logging server either from the nginx or the Docker host itself eliminating the need for an auxiliary logging container.

But as the separate logging agent is strictly required by the task I will proceed with the dedicated logging container option and storing nginx logs on a docker data volume.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.