This configuration seems incorrect.
I think I read that giving my client client.transport.sniff=true would
allow the client to discover other nodes.
With true it won't connect at all, with false it doesn't appear to use the
second node.
Could anyone confirm my setup is valid or invalid.
I created an EC2 instance with this config
cluster:
name: es-dev-cluster
node:
master: true
data: true
transport.tcp.port: 9300
http.port: 9200
action.auto_create_index: true
index.mapper.dynamic: false
discovery:
type: ec2
gateway:
type: s3
s3.bucket: es-dev-cluster
cloud:
aws:
access_key: *********
secret_key: *********
cloud.aws.s3.endpoint: s3.amazonaws.com
cloud.aws.ec2.endpoint: ec2.us-east-1.amazonaws.com
I then snapshotted it and created an AMI. I started up two of this AMI. I
assigned one of the two a static IP.
Using http://staticip:9200/_plugin/head/ I can see both of these nodes.
My client connects explicitly to the static
final Settings settings = ImmutableSettings.settingsBuilder()
.put("cluster.name", clusterName)
.put("discovery.type", "ec2")
.put("node.name", clientRandomNodeName)
.put("node.master", false)
.put("node.data", false)
.put("client.transport.sniff", false)
.build();
final String endpoint = theStaticIp
final int port = 9300;
final Client client = new TransportClient(settings)
.addTransportAddress(new
InetSocketTransportAddress(endpoint, port));
So now my client is connecting to the static ip and I can index new data. I
shutdown the node with the static ip and expected the second node thats on
to get the work. Instead my client is throwing No Node Found.
I have a couple suspicions as to whats I am doing wrong, but am not sure
what else I should do.
- Is it valid for both of these EC2 instances to have the given config?
- Is the method I am using to connect my client to the static ip ES node
valid?
Thanks, Mike