We are using elasticsearch with following topology:
Dedicated master nodes: 3
Dedicated data nodes: 6
ES JAVA clients: 6
While connecting to ES cluster from a java client program, we provide comma separated data hostnames while creating REST
Here is a code snippet:
private static synchronized RestHighLevelClient createConnection() {
if(client == null) {
client = new RestHighLevelClient(
RestClient.builder(
new HttpHost(HOST1, PORT, SCHEME),
new HttpHost(HOST2, PORT, SCHEME),
new HttpHost(HOST3, PORT, SCHEME)));
}
return client;
}
- Is this the right way of connecting to ES cluster?
- Can we give comma separated master nodes instead of data nodes?
- Will there be any performance hit if we use master nodes?