Building ZooKeeper and Elasticsearch containers
These procedures are intended for users with Docker knowledge. We do not provide Docker support, just provide guidelines on how to use it with our product. For more information about Docker, see https://docs.docker.com/
Building ZooKeeper and Elasticsearch images
Please check the correct component version in the Third-Party Component Compatibility page and edit the ZooKeeper and Elasticsearch versions in the configuration files.
To build ZooKeeper and Elasticsearch images
- Create the following file:
zookeeper_elasticsearch/docker-compose.yml
version: '2.4' services: zookeeper: image: zookeeper:3.9.4 container_name: zookeeper mem_limit: 2g environment: - ZOO_4LW_COMMANDS_WHITELIST=ruok healthcheck: test: ["CMD-SHELL", "echo ruok | nc localhost 2181 | grep imok"] interval: 5s timeout: 10s retries: 3 networks: - twc-net ##Below zoonavigator Section is optional### zoonavigator: image: elkozmon/zoonavigator:2.0.0 container_name: zoonavigator ports: - "9000:9000" environment: - "CONNECTION_MYZK_CONN=zookeeper:2181" - "CONNECTION_LOCAL_CONN=localhost:2181" - "AUTO_CONNECT_CONNECTION_ID=MYZK" depends_on: zookeeper: condition: service_healthy networks: - twc-net elasticsearch: image: elasticsearch:7.16.2 container_name: elasticsearch mem_limit: 4g ports: - "9200:9200" environment: - discovery.type=single-node - cluster.routing.allocation.disk.threshold_enabled=false - "ES_JAVA_OPTS=-Xms2g -Xmx2g" healthcheck: test: ["CMD", "nc", "-z", "-w2", "localhost", "9200"] interval: 5s timeout: 5s retries: 60 networks: - twc-net networks: twc-net: external: trueSHELL - Build the image by running the following command:
cd /twc/zookeeper_elasticsearch; docker compose build --no-cacheSHELL - Start the services by running the following command:
docker compose up -dSHELL