We are planning to create ES cluster with about 10 data nodes and 3 dedicated masters and we want to dockerize our cluster. Following is how we are planning to configure:
Let's say there are only 3 nodes in the cluster that includes 1 dedicated master (just to make this topic brief and easy to understand).
IP1: 172.30.84.10 (dedicated master)
IP2: 172.30.84.11
IP3: 172.30.84.12
Then we would use the dockerfile used by elasticsearch and run the following commands:
On host 172.30.84.10 (dedicated master)
docker run -d -p 9200:9200 -p 9300:9300 elasticsearch \
-Des.node.name="es1" \
-Des.cluster.name="mycluster" \
-Des.network.host=_eth0_ \
-Des.network.publish_host=172.30.84.10 \
-Des.discovery.zen.ping.unicast.hosts=172.30.84.10,172.30.84.11,172.30.84.12 \
-Des.discovery.zen.minimum_master_nodes=1 \
-Des.node.master=true \
-Des.node.data=false \
-Des.node.ingest=false
On host 172.30.84.11
docker run -d -p 9200:9200 -p 9300:9300 elasticsearch \
-Des.node.name="es2" \
-Des.cluster.name="mycluster" \
-Des.network.host=_eth0_ \
-Des.network.publish_host=172.30.84.11 \
-Des.discovery.zen.ping.unicast.hosts=172.30.84.10,172.30.84.11,172.30.84.12 \
-Des.discovery.zen.minimum_master_nodes=1
-Des.node.master=false \
-Des.node.data=true
On host 172.30.84.12
docker run -d -p 9200:9200 -p 9300:9300 elasticsearch \
-Des.node.name="es3" \
-Des.cluster.name="mycluster" \
-Des.network.host=_eth0_ \
-Des.network.publish_host=172.30.84.12 \
-Des.discovery.zen.ping.unicast.hosts=172.30.84.10,172.30.84.11,172.30.84.12 \
-Des.discovery.zen.minimum_master_nodes=1
-Des.node.master=false \
-Des.node.data=true
I understand that setting one dedicated master is fatal in case it goes down, but this is just for this example, we would set up at least 3 (odd number). Now, let's say all nodes are up and running. Following are my questions:
-
If we use JAVA ES native client to communicate with ES cluster, should all the queries route through only master or nodes? Or should we register all the IP addresses like the following:
TransportClient client = new PreBuiltTransportClient(Settings.EMPTY)
.addTransportAddress(new InetSocketTransportAddress("172.30.84.10", 9300))
.addTransportAddress(new InetSocketTransportAddress("172.30.84.11", 9300));
.addTransportAddress(new InetSocketTransportAddress("172.30.84.12", 9300)); -
If we should use all IPs, all of these need to be public facing IPs (may be). If not, which IPs should be used in java client?
-
If one of the nodes go down, do we need to update the code/configuration/ip addresses? Is there a better way to handle this? I am sure I am missing something basic, because hard-coding or even configuring the IPs seem like a bad idea (I am not network guy).
-
Do I have to set any other configurations like Gateway settings
Thank you for your help in advance.