Introduction
This is an example to deploy Elasticsearch 6.3.0 docker cluster in GCP without using K8s or docker composer
Note to use composer: click here
Prerequisite
Docker installed
Deployment
Master: 172.16.0.5
sudo sysctl -w vm.max_map_count=262144
docker run -d \
--ulimit nofile=65536:65536 \
-e "node.name=es_master" \
-e "network.publish_host=172.16.0.5" \
-e "discovery.zen.ping.unicast.hosts=172.16.0.5" \
-e "network.host=0.0.0.0" \
-e "network.bind_host=0.0.0.0" \
-e "transport.tcp.port=9300" \
-e "xpack.security.enabled=false" \
-e "cluster.name=dl_elastic_cluster" -e "node.master=true" -e "node.data=true" \
-e "script.painless.regex.enabled=true" \
-e ES_JAVA_OPTS="-Xms23g -Xmx23g" \
-p 9200:9200 -p 9300:9300 \
-v /usr/share/es_data:/usr/share/elasticsearch/data \
docker.elastic.co/elasticsearch/elasticsearch:6.3.0
Slave: 172.16.0.2
sudo sysctl -w vm.max_map_count=262144
docker run -d \
--ulimit nofile=65536:65536 \
-e "node.name=es_data1" \
-e "discovery.zen.ping.unicast.hosts=172.16.0.5" \
-e "network.publish_host=172.16.0.2" \
-e "network.host=0.0.0.0" \
-e "transport.tcp.port=9300" \
-e "xpack.security.enabled=false" \
-e "cluster.name=dl_elastic_cluster" -e "node.master=false" -e "node.data=true" \
-e "script.painless.regex.enabled=true" \
-e ES_JAVA_OPTS="-Xms23g -Xmx23g" \
-p 9200:9200 -p 9300:9300 \
-v /usr/share/es_data:/usr/share/elasticsearch/data \
docker.elastic.co/elasticsearch/elasticsearch:6.3.0