本文环境为:
三台机器:192.168.100.169 192.168.100.170 192.168.100.171均已安装了elasticsearch,现将三台机器设置为集群环境
elasticsearch.yml
#------------------------------------cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
# 集群名称
cluster.name: es-common
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
# 节点名称
node.name: node-169
# 当前节点是否作为主节点,true表示会;false表示不会
node.master: true
# 当前节点是否用于存储数据,是:true、否:false
node.data: true
#
# ----------------------------------- Paths ------------------------------------
#
# 数据位置
path.data: /var/tmp/data/elasticsearch/esdata
#
# 日志位置
path.logs: /var/tmp/data/elasticsearch/eslog
#
# ----------------------------------- Memory -----------------------------------
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: 0.0.0.0
#
# Set a custom port for HTTP:
#
#http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
# es7.x 之后新增的配置,写入候选主节点的设备地址,在开启服务后可以被选为主节点
discovery.seed_hosts: ["192.168.100.169", "192.168.100.170", "192.168.100.171"]
# es7.x