We would like to install a bigger graylog cluster, with 4 elasticsearch node, on 2 phisical different site.
I can set elasticsearch replica, but how can I provide the system will make the replica on different site?
(Of yourse I can set 3 replica, or at least 2, and in this case at least one will on different site, but if I set only 1 replica would be the best with an automatic “separation” instead set the location on every shard/index evertime)
I have finnished my server installation, and the solution was:
/etc/elasticsearch/elasticsearch.yml
node.site: A
cluster.routing.allocation.awareness.force.site.values: A,B
cluster.routing.allocation.awareness.attributes: site
And the result:
curl -XGET http://IP:9200/_cat/shards
...
graylog_1 1 p STARTED 1735 242.1kb IP.220 HOST_b1
graylog_1 1 r STARTED 1735 242kb IP.216 HOST_a2
graylog_1 0 r STARTED 1813 250.5kb IP.221 HOST_b2
graylog_1 0 p STARTED 1813 250.6kb IP.215 HOST_a1
graylog_2 1 p STARTED 2804 412.3kb IP.215 HOST_a1
graylog_2 1 r STARTED 2804 406.1kb IP.220 HOST_b1
graylog_2 0 p STARTED 2833 393.3kb IP.221 HOST_b2
graylog_2 0 r STARTED 2833 393.3kb IP.216 HOST_a2