Creating ES Cluster with dedicated masters

(Animageofmine) #1

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: (dedicated master)

Then we would use the dockerfile used by elasticsearch and run the following commands:

On host (dedicated master)

docker run -d -p 9200:9200 -p 9300:9300 elasticsearch \"es1" \"mycluster" \ \ \,, \
-Des.discovery.zen.minimum_master_nodes=1 \
-Des.node.master=true \ \

On host

docker run -d -p 9200:9200 -p 9300:9300 elasticsearch \"es2" \"mycluster" \ \ \,, \
-Des.node.master=false \

On host

docker run -d -p 9200:9200 -p 9300:9300 elasticsearch \"es3" \"mycluster" \ \ \,, \
-Des.node.master=false \

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:

  1. 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("", 9300))
    .addTransportAddress(new InetSocketTransportAddress("", 9300));
    .addTransportAddress(new InetSocketTransportAddress("", 9300));

  2. 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?

  3. 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).

  4. Do I have to set any other configurations like Gateway settings

Thank you for your help in advance.

(Mark Walkom) #2
  1. Data or client, never dedicated masters.
  2. Whatever is routable in your environment.
  3. Just replace the node but use the same address. Otherwise use DNS. Or yes, you will need to update things.
  4. Ideally, yes.

(Animageofmine) #3

Great, thank you so much.

  1. If sniff is enabled (client.transport.sniff), do I still need to specify all IPs? My understanding is that sniff will allow the client to get all the other nodes in the network if new nodes were added at all.
  2. For answer of my 4th question, you mentioned ideally yes. Does this mean the settings are optional? Would appreciate a bit verbose response here.

Is there a sample setup that I can reference? Its kind of hard to find anywhere on the web, googled quite a bit.

(Mark Walkom) #4

Sniff is just a seed, so it'll get any other nodes in the cluster.

It's always a good idea to add settings that can improve recovery speeds. However these are set in the config file which means if you add nodes you need to alter them! You can also set these via the APIs.

(Animageofmine) #5

An example or verbose reply would help. I guess a lot of things that are implicit to you are not implicit to me :slight_smile:

(Mark Walkom) #6

Ahh sorry, these were updatable via the APIs in 2.X, not in 5.

(Animageofmine) #7

We are planning to use 2.4 most likely until version 5.0 is fully baked. Are these configs optional or mandatory?

(Mark Walkom) #8


(Animageofmine) #9

Thank you!

(system) #10

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.