阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

Elasticsearch多节点集群配置文件

112次阅读
没有评论

共计 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

正文完
星哥说事-微信公众号
post-qrcode
 
星锅
版权声明:本站原创文章,由 星锅 2022-01-21发表,共计3138字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中