Applications

Starting Elastic Logging Aggregator for Development

Elastic stack (Elasticsearch, Logstash, Kibana and Filebeat) is used to aggregate logs generated from TMT applications (Scala/Java/Python/C++/C) and CSW services (mentioned in the previous section). For development purposes, Docker compose is used. Hence, make sure that latest Docker setup is installed and running before starting the Elastic stack. To know more about how Elastic stack works please refer to Logging Aggregator.

For the host setup, follow the below given steps:

On distributions which have SELinux enabled out-of-the-box, you will need to either re-context the files or set SELinux into Permissive mode in order for docker-elk to start properly. For example, on Redhat and CentOS, the following will apply the proper context:

$ chcon -R system_u:object_r:admin_home_t:s0 docker-elk/

To know more about running Docker for Mac please refer to this link. For Windows, ensure that the “Shared Drives” feature is enabled for the C: drive (Docker for Windows > Settings > Shared Drives). See Configuring Docker for Windows Shared Drives (MSDN Blog).

Assuming that the developer has downloaded logging-aggregator-<some-version>.zip from csw releases and unzipped it, there is one folder, as follows, in logging-aggregator-<some-version>:

  • logging_aggregator

Go to logging_aggreator/dev and run

  • docker-compose build --no-cache
  • docker-compose up --force-recreate

This will start Filebeat, Elasticsearch, Logstash and Kibana in a Docker container. Note that csw-services application will generate all log files under /tmp/tmt/logs/csw and Filebeat will watch for them there.

Once, the Docker container is up, open an browser and go to http://localhost:5601/ to use Kibana. Go to:

  • Management -> Kibana -> Index Patterns and create an index pattern as per the requirement.
  • Discover -> Select the index pattern created and explore

To use a different Elastic Stack version than the one currently available in the repository, simply change the version in logging_aggreator/dev/.env file, and rebuild the stack with:

  • docker-compose build --no-cache
  • docker-compose up --force-recreate

Always pay attention to the upgrade instructions for each individual component before performing a stack upgrade.