The master config file comes with (commented out) example of how to do
unicast discovery (and disabling
multicast): https://github.com/elasticsearch/elasticsearch/blob/master/config/elasticsearch.yml.
Ok, I'm trying that with the ping.unicast.hosts set to
["kvm-alpha:9300", "kvm-beta:9300", "kvm-gamma:9300"] and
elasticsearch running at version 0.16.2. Only kvm-alpha and kvm-gamma
are running, so those are the only two machines where Elasticsearch
is currently running. It's behaving differently now, anyhow.
/_cluster/state for each machine lists only the elasticsearch running
on that machine. netstat shows that both machine's elasticsearch's
have connections to port 9300 of the other machine, so they are in
contact, but the don't seem to quite be meshing. A pretty dump of
/_cluster/state is at the bottom of this email. /_cluster/health now
shows red; I'm not sure what to make of the rest of its values though.
I definitely have no idea if it's red because it realizes that nodes
are missing, or for some other reason. I'm guessing that the only
reason ES was working at all before was due to the multicast cluster
configuration taking over, so now I have something just plain wrong.
For basic diagnostics, each machine can ping each other by short name.
/var/log/elasticsearch/blah.log has a lot of
java.net.NoRouteToHostExceptions; I'm assuming these are due to the
kvm-beta host of my unicast hosts, but the traceback doesn't actually
say which host has no route, so I can't be sure. Other than that,
I've wiped out /var/lib/elasticsearch/data/* and
/var/lib/elasticsearch/work/*; not sure what else I can do.
/_cluster/state on kvm-gamma:
{
"cluster_name" : "blah",
"master_node" : "Isx1p9MgS3OKxfrt_OPKcg",
"blocks" : {
"global" : {
"1" : {
"description" : "state not recovered / initialized",
"retryable" : true,
"disable_state_persistence" : true,
"levels" : [ "read", "write", "metadata" ]
}
}
},
"nodes" : {
"Isx1p9MgS3OKxfrt_OPKcg" : {
"name" : "American Dream",
"transport_address" : "inet[/10.77.97.31:9300]",
"attributes" : {
}
}
},
"metadata" : {
"templates" : {
},
"indices" : {
}
},
"routing_table" : {
"indices" : {
}
},
"routing_nodes" : {
"unassigned" : ,
"nodes" : {
}
},
"allocations" :
}
/_cluster/info on kvm-gamma
{
"cluster_name" : "blah",
"status" : "red",
"timed_out" : false,
"number_of_nodes" : 1,
"number_of_data_nodes" : 1,
"active_primary_shards" : 0,
"active_shards" : 0,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 0
}
and my elasticsearch.yml:
Cluster Settings
cluster:
name: blah
Path Settings
path:
conf: /usr/share/elasticsearch/conf
data: /var/lib/elasticsearch/data
work: /var/lib/elasticsearch/work
logs: /var/log/elasticsearch
Gateway Settings
gateway:
recover_after_nodes: 1
recover_after_time: 5m
expected_nodes: 2
Force all memory to be locked, forcing JVM to never swap
(make sure to set MIN and MAX mem to the same value)
#bootstrap:
mlockall: true
Unicast Discovery (disable multicast)
discovery:
zen:
multicast.enabled: false
ping.unicast.hosts: ["kvm-alpha:9300", "kvm-beta:9300", "kvm-gamma:9300"]