elasticsearch 集群的搭建
2016-06-23 16:42
274 查看
1. 首先要确定每台linux 主机的防火墙以关闭了。可以通过 service iptables stop 命令来关闭防火墙。
2. 要坚持这个原则,在es的config 下的配置文件xxx.yml 文件最好不要有太多的改动。即使改动也要在配置文件的基础上改动,意思是比如(es配置一部分)
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
discovery.zen.ping.unicast.hosts: ["192.168.136.129", "192.168.136.130"]
#
# Prevent the "split brain" by configuring the majority of nodes (total number of nodes / 2 + 1):
#
如果想增加直接去掉# 就行 因为所以的配置 这里面都有,只要去掉#开启就行,不需要自己手动增加,在这里开启了discovery.zen.ping.unicast.hosts: ["192.168.136.129", "192.168.136.130"] 配置
3.要知道改什么配置项。
前两点好做
在第三点上该一下几点:
1. cluste.name 必须每个节点相同。在这里用的是my-application
#
cluster.name: my-application
#
# ------------------------------------ Node ------------------------------------
#
2.增加node 节点名 。在这里每个节点必须不同。 你可以用node-1 ,node-2 ...
# Use a descriptive name for the node:
#
node.name: node-2
#
# Add custom attributes to the node:
#
3. 增加ip地址,该地址为该主机(节点)的ip地址
Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: 192.168.136.130
#
# Set a custom port for HTTP:
#
4 增加节点的ip (比如你在129 ,和130 都开启了es 那么在这里都配上) 并且每个es 的都需要配置该项(都一样)
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
discovery.zen.ping.unicast.hosts: ["192.168.136.129", "192.168.136.130"]
#
# Prevent the "split brain" by configuring the majority of nodes (total number of nodes / 2 + 1):
#
这样起每个es 节点就行了。
2. 要坚持这个原则,在es的config 下的配置文件xxx.yml 文件最好不要有太多的改动。即使改动也要在配置文件的基础上改动,意思是比如(es配置一部分)
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
discovery.zen.ping.unicast.hosts: ["192.168.136.129", "192.168.136.130"]
#
# Prevent the "split brain" by configuring the majority of nodes (total number of nodes / 2 + 1):
#
如果想增加直接去掉# 就行 因为所以的配置 这里面都有,只要去掉#开启就行,不需要自己手动增加,在这里开启了discovery.zen.ping.unicast.hosts: ["192.168.136.129", "192.168.136.130"] 配置
3.要知道改什么配置项。
前两点好做
在第三点上该一下几点:
1. cluste.name 必须每个节点相同。在这里用的是my-application
#
cluster.name: my-application
#
# ------------------------------------ Node ------------------------------------
#
2.增加node 节点名 。在这里每个节点必须不同。 你可以用node-1 ,node-2 ...
# Use a descriptive name for the node:
#
node.name: node-2
#
# Add custom attributes to the node:
#
3. 增加ip地址,该地址为该主机(节点)的ip地址
Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: 192.168.136.130
#
# Set a custom port for HTTP:
#
4 增加节点的ip (比如你在129 ,和130 都开启了es 那么在这里都配上) 并且每个es 的都需要配置该项(都一样)
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
discovery.zen.ping.unicast.hosts: ["192.168.136.129", "192.168.136.130"]
#
# Prevent the "split brain" by configuring the majority of nodes (total number of nodes / 2 + 1):
#
这样起每个es 节点就行了。
相关文章推荐
- PHP自动给URl添加http://前缀
- POJ-2386 Lake Counting
- android sqlite数据库简测
- 判断一棵树是否为满二叉树
- 运动目标检测--基于直方图匹配的鬼影消除
- 如何插入谷歌地图并获取javascript api 秘钥
- java 友好的显示时间
- mysql group_concat函数被截断的问题
- 容器间建立连接案例-mysql
- PostgreSQL错误代码速查
- 运动目标检测--帧间差分与背景差分相融合
- canvas 详细使用教程
- Objective-C映客房间消息策略分析与实现
- 讯飞语音开发之文本理解
- 算法导论_第二章_算法基础
- 链表面试题之约瑟夫环问题
- 中值滤波
- swift 小练习
- MySQL索引背后的数据结构及算法原理
- find 命令