1 es部署参考单节点部署
参考博客:https://blog.csdn.net/qq_35875008/article/details/115242056
2 多节点只需修改配置文件
master节点(3节点)
master1节点:
#集群名称
cluster.name: es-cluster
#节点名称
node.name: es-master-01
#是否是master节点,master节点存元数据
node.master: true
#是否是data数据节点,data数据节点存数据
node.data: false
#是否是ingest节点,ingest节点可以在数据真正进入index前,通过配置pipline拦截器对数据ETL
node.ingest: false
#数据目录,可挂载多个盘
path.data: /data/elasticsearch/data
path.logs: /data/elasticsearch/logs
#http host和port
network.host: 0.0.0.0
http.port: 9200
transport.tcp.port: 9300
#设置是否压缩tcp上交互传输的数据
transport.tcp.compress: true
#设置集群中的Master节点的初始列表,可以通过这些节点来自动发现其他新加入集群的节点
discovery.zen.ping.unicast.hosts: [es-master-01,es-master-02,es-master-03]
#指定集群初始节点
cluster.initial_master_nodes: es-master-01
#防止脑裂配置,注意在多master时,这个值应该等于 Math.floor(master候选节点数/2)+1,#意思是master候选节点的数目最少达到多少个,才去选举master
discovery.zen.minimum_master_nodes: 2
# 设置跨域问题,方便使用elasticsearch-head来检测集群状态
http.cors.enabled: true
http.cors.allow-origin: /.*/
xpack.watcher.enabled: true
xpack.security.enabled: false
xpack.monitoring.enabled: true
xpack.monitoring.collection.enabled: true
master2节点:
#集群名称
cluster.name: es-cluster
#节点名称
node.name: es-master-02
#是否是master节点,master节点存元数据
node.master: true
#是否是data数据节点,data数据节点存数据
node.data: false
#是否是ingest节点,ingest节点可以在数据真正进入index前,通过配置pipline拦截器对数据ETL
node.ingest: false
#数据目录,可挂载多个盘
path.data: /data/elasticsearch/data
path.logs: /data/elasticsearch/logs
#http host和port
network.host: 0.0.0.0
http.port: 9200
transport.tcp.port: 9300
#设置是否压缩tcp上交互传输的数据
transport.tcp.compress: true
#设置集群中的Master节点的初始列表,可以通过这些节点来自动发现其他新加入集群的节点
discovery.zen.ping.unicast.hosts: [es-master-01,es-master-02,es-master-03]
#指定集群初始节点
cluster.initial_master_nodes: es-master-01
#防止脑裂配置,注意在多master时,这个值应该等于 Math.floor(master候选节点数/2)+1,#意思是master候选节点的数目最少达到多少个,才去选举master
discovery.zen.minimum_master_nodes: 2
# 设置跨域问题,方便使用elasticsearch-head来检测集群状态
http.cors.enabled: true
http.cors.allow-origin: /.*/
xpack.watcher.enabled: true
xpack.security.enabled: false
xpack.monitoring.enabled: true
xpack.monitoring.collection.enabled: true
master3节点:
#集群名称
cluster.name: es-cluster
#节点名称
node.name: es-master-03
#是否是master节点,master节点存元数据
node.master: true
#是否是data数据节点,data数据节点存数据
node.data: false
#是否是ingest节点,ingest节点可以在数据真正进入index前,通过配置pipline拦截器对数据ETL
node.ingest: false
#数据目录,可挂载多个盘
path.data: /data/elasticsearch/data
path.logs: /data/elasticsearch/logs
#http host和port
network.host: 0.0.0.0
http.port: 9200
transport.tcp.port: 9300
#设置是否压缩tcp上交互传输的数据
transport.tcp.compress: true
#设置集群中的Master节点的初始列表,可以通过这些节点来自动发现其他新加入集群的节点
discovery.zen.ping.unicast.hosts: [es-master-01,es-master-02,es-master-03]
#指定集群初始节点
cluster.initial_master_nodes: es-master-01
#防止脑裂配置,注意在多master时,这个值应该等于 Math.floor(master候选节点数/2)+1,#意思是master候选节点的数目最少达到多少个,才去选举master
discovery.zen.minimum_master_nodes: 2
# 设置跨域问题,方便使用elasticsearch-head来检测集群状态
http.cors.enabled: true
http.cors.allow-origin: /.*/
xpack.watcher.enabled: true
xpack.security.enabled: false
xpack.monitoring.enabled: true
xpack.monitoring.collection.enabled: true
node节点(3节点)
node1节点:
#集群名称
cluster.name: es-cluster
#节点名称
node.name: es-node-01
#是否是master节点,master节点存元数据
node.master: false
#是否是data数据节点,data数据节点存数据
node.data: true
#是否是ingest节点,ingest节点可以在数据真正进入index前,通过配置pipline拦截器对数据ETL
node.ingest: false
#数据目录,可挂载多个盘
path.data: /data/elasticsearch/data
path.logs: /data/elasticsearch/logs
#http host和port
network.host: 0.0.0.0
http.port: 9200
transport.tcp.port: 9300
#设置是否压缩tcp上交互传输的数据
transport.tcp.compress: true
#bootstrap.memory_lock: true
#设置集群中的Master节点的初始列表,可以通过这些节点来自动发现其他新加入集群的节点
discovery.zen.ping.unicast.hosts: [es-master-01,es-master-02,es-master-03]
#指定集群初始节点
cluster.initial_master_nodes: es-master-01
# 设置跨域问题,方便使用elasticsearch-head来检测集群状态
http.cors.enabled: true
http.cors.allow-origin: /.*/
xpack.watcher.enabled: true
xpack.security.enabled: false
xpack.monitoring.enabled: true
xpack.monitoring.collection.enabled: true
node2节点:
#集群名称
cluster.name: es-cluster
#节点名称
node.name: es-node-02
#是否是master节点,master节点存元数据
node.master: false
#是否是data数据节点,data数据节点存数据
node.data: true
#是否是ingest节点,ingest节点可以在数据真正进入index前,通过配置pipline拦截器对数据ETL
node.ingest: false
#数据目录,可挂载多个盘
path.data: /data/elasticsearch/data
path.logs: /data/elasticsearch/logs
#http host和port
network.host: 0.0.0.0
http.port: 9200
transport.tcp.port: 9300
#设置是否压缩tcp上交互传输的数据
transport.tcp.compress: true
#设置集群中的Master节点的初始列表,可以通过这些节点来自动发现其他新加入集群的节点
discovery.zen.ping.unicast.hosts: [es-master-01,es-master-02,es-master-03]
#指定集群初始节点
cluster.initial_master_nodes: es-master-01
# 设置跨域问题,方便使用elasticsearch-head来检测集群状态
http.cors.enabled: true
http.cors.allow-origin: /.*/
xpack.watcher.enabled: true
xpack.security.enabled: false
xpack.monitoring.enabled: true
xpack.monitoring.collection.enabled: true
node3节点:
#集群名称
cluster.name: es-cluster
#节点名称
node.name: es-node-03
#是否是master节点,master节点存元数据
node.master: false
#是否是data数据节点,data数据节点存数据
node.data: true
#是否是ingest节点,ingest节点可以在数据真正进入index前,通过配置pipline拦截器对数据ETL
node.ingest: false
#数据目录,可挂载多个盘
path.data: /data/elasticsearch/data
path.logs: /data/elasticsearch/logs
#http host和port
network.host: 0.0.0.0
http.port: 9200
transport.tcp.port: 9300
#设置是否压缩tcp上交互传输的数据
transport.tcp.compress: true
#设置集群中的Master节点的初始列表,可以通过这些节点来自动发现其他新加入集群的节点
discovery.zen.ping.unicast.hosts: [es-master-01,es-master-02,es-master-03]
#指定集群初始节点
cluster.initial_master_nodes: es-master-01
# 设置跨域问题,方便使用elasticsearch-head来检测集群状态
http.cors.enabled: true
http.cors.allow-origin: /.*/
xpack.watcher.enabled: true
xpack.security.enabled: false
xpack.monitoring.enabled: true
xpack.monitoring.collection.enabled: true