共计 3138 个字符,预计需要花费 8 分钟才能阅读完成。
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 全程记录 http://www.linuxidc.com/Linux/2015-09/123241.htm
Elasticsearch 安装使用教程 http://www.linuxidc.com/Linux/2015-02/113615.htm
ElasticSearch 配置文件译文解析 http://www.linuxidc.com/Linux/2015-02/114244.htm
ElasticSearch 集群搭建实例 http://www.linuxidc.com/Linux/2015-02/114243.htm
分布式搜索 ElasticSearch 单机与服务器环境搭建 http://www.linuxidc.com/Linux/2012-05/60787.htm
ElasticSearch 的工作机制 http://www.linuxidc.com/Linux/2014-11/109922.htm
Elasticsearch 的安装,运行和基本配置 http://www.linuxidc.com/Linux/2016-07/133057.htm
使用 Elasticsearch + Logstash + Kibana 搭建日志集中分析平台实践 http://www.linuxidc.com/Linux/2015-12/126587.htm
Ubuntu 14.04 搭建 ELK 日志分析系统 (Elasticsearch+Logstash+Kibana) http://www.linuxidc.com/Linux/2016-06/132618.htm
Elasticsearch1.7 升级到 2.3 实践总结 http://www.linuxidc.com/Linux/2016-11/137282.htm
Ubuntu 14.04 中 Elasticsearch 集群配置 http://www.linuxidc.com/Linux/2017-01/139460.htm
Elasticsearch-5.0.0 移植到 Ubuntu 16.04 http://www.linuxidc.com/Linux/2017-01/139505.htm
ElasticSearch 5.2.2 集群环境的搭建 http://www.linuxidc.com/Linux/2017-04/143136.htm
ElasticSearch 的详细介绍 :请点这里
ElasticSearch 的下载地址 :请点这里
本文永久更新链接地址 :http://www.linuxidc.com/Linux/2017-04/143181.htm