Elasticsearch多节点集群配置文件

Elasticsearch多节点集群配置文件

192.168.18.186  安装一个Elasticsearch节点
192.168.18.187  安装两个Elasticsearch节点

主机1安装一个节点的配置文件(192.168.18.186 )
/usr/local/elasticsearch-1.7.3/config/elasticsearch.yml
cluster.name: elastic-product
node.name: "node18.186"
bootstrap.mlockall: true
network.host: 192.168.18.186
discovery.zen.ping.timeout: 60s
discovery.zen.fd.ping_timeout: 60s
discovery.zen.minimum_master_nodes: 2
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["192.168.18.186","192.168.18.187","192.168.18.187:9301"]
index.cache.field.max_size: 50000
index.cache.field.expire: 10m
index.cache.field.type: soft
indices.fielddata.cache.size: 10%
#path.data: /path/to/data
 

说明:为了防止“脑裂”出现,discovery.zen.minimum_master_nodes参数设置的数字=(集群中节点数/2)+1,如两台或者三台主机则配置,如果只有一个节点,此配置可去掉或配置1。

主机2安装两个节点的配置文件(192.168.18.187)
1、节点一
/usr/local/elasticsearch-1.7.3/config/elasticsearch.yml
cluster.name: elastic-product
node.name: "node18.187"
bootstrap.mlockall: true
network.host: 192.168.18.187
discovery.zen.ping.timeout: 60s
discovery.zen.fd.ping_timeout: 60s
discovery.zen.minimum_master_nodes: 2
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["192.168.18.186","192.168.18.187","192.168.18.187:9301"]
index.cache.field.max_size: 50000
index.cache.field.expire: 10m
index.cache.field.type: soft
indices.fielddata.cache.size: 10%
#path.data: /path/to/data

2、节点二
/usr/local/elasticsearch-1.7.3-rep2/config/elasticsearch.yml
cluster.name: elastic-product
node.name: "node18.187-rep2"
bootstrap.mlockall: true
network.host: 192.168.18.187
discovery.zen.ping.timeout: 60s
discovery.zen.fd.ping_timeout: 60s
discovery.zen.minimum_master_nodes: 2
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["192.168.18.186","192.168.18.187","192.168.18.187:9301"]
transport.tcp.port: 9301
http.port: 9201
index.cache.field.max_size: 50000
index.cache.field.expire: 10m
index.cache.field.type: soft
indices.fielddata.cache.size: 10%
#path.data: /path/to/data
 

添加为开机自启方法:
sudo vim /etc/rc.local
/usr/local/elasticsearch-1.7.3-2/bin/elasticsearch -d /usr/local/elasticsearch-1.7.3-2/conf/elasticsearch.yml

Linux上安装部署ElasticSearch全程记录 

Elasticsearch安装使用教程

ElasticSearch 配置文件译文解析

ElasticSearch集群搭建实例 

分布式搜索ElasticSearch单机与服务器环境搭建 

ElasticSearch的工作机制   

Elasticsearch的安装,运行和基本配置

使用Elasticsearch + Logstash + Kibana搭建日志集中分析平台实践 

Ubuntu 14.04搭建ELK日志分析系统(Elasticsearch+Logstash+Kibana)

Elasticsearch1.7升级到2.3实践总结 

Ubuntu 14.04中Elasticsearch集群配置 

Elasticsearch-5.0.0移植到Ubuntu 16.04

ElasticSearch 5.2.2 集群环境的搭建 

ElasticSearch 的详细介绍请点这里
ElasticSearch 的下载地址请点这里 

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/02526b04ae4e67d0807d5193471f488a.html