I'm using the code below to create transport clients and verify that
all nodes are in sync with what they see. Basically, a poor mans split
cluster check. However, it does not appear the 0.14.2 transport client
is honoring the cluster name that I have set I would expect the code
below to only connect to a cluster named "0.14.2", but it succeeds in
connecting to my cluster named "0.13.0". Here is the code:
Map<String,String> m = new HashMap<String,String>();
m.put("cluster.name","0.14.2");
Settings s = ImmutableSettings.settingsBuilder().put(m).build();
for (String server : servers) {
int port = 9300;
Client client = new TransportClient(s).addTransportAddress(new
InetSocketTransportAddress(server, port));
NodesInfoResponse response = null;
try {
response = new
Yea, the behavior changed. By default, the transport client does not sniff other nodes in the cluster now, and uses the provided ips to connect to the nodes (and not the publish host ips the nodes are configured with). This make sense when trying to talk to nodes over firewall or that have public and private ip (as in AWS) from outside.
To enable the sniff option, and have the transport client sniff out all the nodes in the cluster, set the client.transport.sniff setting to true. This will also do cluster name based filtering.
The fact that without sniffing enabled there is no cluster name filtering is a bug. Can you open an issue for this and I will fix it for 0.15?
-shay.banon
On Wednesday, January 19, 2011 at 8:01 PM, Paul wrote:
I'm using the code below to create transport clients and verify that
all nodes are in sync with what they see. Basically, a poor mans split
cluster check. However, it does not appear the 0.14.2 transport client
is honoring the cluster name that I have set I would expect the code
below to only connect to a cluster named "0.14.2", but it succeeds in
connecting to my cluster named "0.13.0". Here is the code:
Map<String,String> m = new HashMap<String,String>();
m.put("cluster.name","0.14.2");
Settings s = ImmutableSettings.settingsBuilder().put(m).build();
for (String server : servers) {
int port = 9300;
Client client = new TransportClient(s).addTransportAddress(new
InetSocketTransportAddress(server, port));
Yea, the behavior changed. By default, the transport client does not sniff other nodes in the cluster now, and uses the provided ips to connect to the nodes (and not the publish host ips the nodes are configured with). This make sense when trying to talk to nodes over firewall or that have public and private ip (as in AWS) from outside.
To enable the sniff option, and have the transport client sniff out all the nodes in the cluster, set the client.transport.sniff setting to true. This will also do cluster name based filtering.
The fact that without sniffing enabled there is no cluster name filtering is a bug. Can you open an issue for this and I will fix it for 0.15?
-shay.banon
On Wednesday, January 19, 2011 at 8:01 PM, Paul wrote:
I'm using the code below to create transport clients and verify that
all nodes are in sync with what they see. Basically, a poor mans split
cluster check. However, it does not appear the 0.14.2 transport client
is honoring the cluster name that I have set I would expect the code
below to only connect to a cluster named "0.14.2", but it succeeds in
connecting to my cluster named "0.13.0". Here is the code:
Map<String,String> m = new HashMap<String,String>();
m.put("cluster.name","0.14.2");
Settings s = ImmutableSettings.settingsBuilder().put(m).build();
for (String server : servers) {
int port = 9300;
Client client = new TransportClient(s).addTransportAddress(new
InetSocketTransportAddress(server, port));
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.