基本上,您只需要配置网络设置以确保所有节点都能在网络上看到对方。另外,由于您在同一台计算机上运行两个节点,并且仍然希望获得高可用性,因此您希望防止主碎片及其副本落在同一台物理计算机上。
最后,由于您的集群中总共有四个节点,因此您要防止出现脑裂情况,因此也需要进行设置
discovery.zen.minimum_master_nodes。
SRC01上的节点1/2:
# cluster namecluster.name: Name_of_your_cluster# Give each node a different name (optional but good practice if you don't know Marvel characters)node.name: SRC01_Node1/2# The IP that this node will bind to and publishnetwork.host: 172.21.0.21# The IP of the other nodesdiscovery.zen.ping.unicast.hosts: ["172.21.0.22"]# prevent split braindiscovery.zen.minimum_master_nodes: 3# to prevent primary/replica shards to be on the same physical host # see why at http://stackoverflow.com/questions/35677741/proper-value-of-es-heap-size-for-a-dedicated-machine-with-two-nodes-in-a-clustercluster.routing.allocation.same_shard.host: true# prevent memory swappingbootstrap.mlockall: true
SRC02上的节点1/2:
# cluster namecluster.name: Name_of_your_cluster# Give each node a different name (optional but good practice if you don't know Marvel characters)node.name: SRC02_Node1/2# The IP that this node will bind to and publishnetwork.host: 172.21.0.22# The IP of the other nodesdiscovery.zen.ping.unicast.hosts: ["172.21.0.21"]# prevent split braindiscovery.zen.minimum_master_nodes: 3# to prevent primary/replica shards to be on the same physical host # see why at http://stackoverflow.com/questions/35677741/proper-value-of-es-heap-size-for-a-dedicated-machine-with-two-nodes-in-a-clustercluster.routing.allocation.same_shard.host: true# prevent memory swappingbootstrap.mlockall: true



