0.14.2 TransportClient does not appear to be honoring cluster name?


(ppearcy) #1

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

NodesInfoRequestBuilder(client.admin().cluster()).execute().actionGet();
} catch (NoNodeAvailableException e) {}
client.close();

			if (response == null) {
				logger.debug("Unable to retrieve cluster status for "

+ESSearcherServer.es.clusterName+ " from: " + server);
continue;
}

			// Confirm that Node counts are the same between each client...
		}

I believe this behavior has changed since 0.13, as the 0.13 nodes that
are doing checks aren't able to see the 0.14.2 nodes.

Thanks!
Paul


(Shay Banon) #2

Heya,

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));

NodesInfoResponse response = null;
try {
response = new
NodesInfoRequestBuilder(client.admin().cluster()).execute().actionGet();
} catch (NoNodeAvailableException e) {}
client.close();

if (response == null) {
logger.debug("Unable to retrieve cluster status for "
+ESSearcherServer.es.clusterName+ " from: " + server);
continue;
}

// Confirm that Node counts are the same between each client...
}

I believe this behavior has changed since 0.13, as the 0.13 nodes that
are doing checks aren't able to see the 0.14.2 nodes.

Thanks!
Paul


(ppearcy) #3

Sure thing:

Will try out the sniff option and let you know if there are any
problems with it.

Thanks!

On Jan 19, 12:19 pm, Shay Banon shay.ba...@elasticsearch.com wrote:

Heya,

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));

NodesInfoResponse response = null;
try {
response = new
NodesInfoRequestBuilder(client.admin().cluster()).execute().actionGet();
} catch (NoNodeAvailableException e) {}
client.close();

if (response == null) {
logger.debug("Unable to retrieve cluster status for "
+ESSearcherServer.es.clusterName+ " from: " + server);
continue;
}

// Confirm that Node counts are the same between each client...
}

I believe this behavior has changed since 0.13, as the 0.13 nodes that
are doing checks aren't able to see the 0.14.2 nodes.

Thanks!
Paul


(system) #4