手机版
你好,游客 登录 注册
背景:
阅读新闻

Elasticsearch多节点集群配置文件

[日期:2017-04-25] 来源:Linux社区  作者:msiyuetian [字体: ]

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

linux
相关资讯       ElasticSearch集群  Elasticsearch多节点 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款