The .env file is your environment variable file and is used to define your enviornment variables
- ${VERSION}
- specifies the version eg: 7.4.1
- ${ELASTIC_SEARCH_CLUSTER_NAME}
- Name of the elastic search cluster
- ${ELASTIC_PORTS}
- Default port: 9200:9200
- ${KIBANA_SERVER_NAME}
- Default is kibana.local
- ${KIBANA_PORTS}
- Default port is 5601:5601
- Update the .env to reflect your requirements.
- Build the image by running
docker-compose up -d
it is important to run this from the same directory as the docker-compose.yml and .env files - To shutdown the environment run
docker-compose down
- To shutdown the environment and delete the volumes
docker-compose down -v
Ensure the vm.max_map_count=262144 as this is required to run.
- To check your vm.max_map_count type:
sysctl vm.max_map_count
- To set vm.max_map_count type:
sysctl -w vm.max_map_count=262144
orecho "vm.max_map_count=262144" >> /etc/sysctl.conf
In this solution elastic search is setup in a 2 node cluster, the cluster names and network can be configured in the .env file.
Once started, you can test if elastic search is running typing: curl http://localhost:9200/_cluster/health?pretty
The deafult host for elasticsearch is https://elasticsearch:9200 but needs to be setup as the deafult host of our cluster which is defined by the variable ELASTIC_NODE_1.
Once running, Kibana can be accessed by going to http://localhost:5601. 5601 is the default port, if you have specified a different port, than you ned to replace this with the defined port
- To view all images run :
docker-compose images
- To get shell access to a server type:
docker-compose exec container-name command
- e.g:.docker-compose exec owncloud /bin/bash