ES集群构建(二)

配置从target="_blank">节点1

1、vi /elasticsearch/conf/elasticsearch.yml

cluster.name: elastic-cluster
node.name: slave1
path.data: /usr/local/soft/elasticsearch-slave1/data/
path.logs: /usr/local/soft/elasticsearch-slave1/logs/
bootstrap.memory_lock: true
network.host: 192.168.162.72
http.port: 9201
//主节点地址,若有多个,则配置多个
discovery.zen.ping.unicast.hosts: ["192.168.162.72"]
http.cors.enabled: true
http.cors.allow-origin: "*"

2、启动服务 -d 后台启动

./elasticsearch/bin/elasticsearch -d 

配置从节点2

1、vi /elasticsearch/conf/elasticsearch.yml

cluster.name: elastic-cluster
node.name: slave2
path.data: /usr/local/soft/elasticsearch-slave2/data/
path.logs: /usr/local/soft/elasticsearch-slave2/logs/
bootstrap.memory_lock: true
network.host: 192.168.162.72
http.port: 9202
//主节点地址,若有多个,则配置多个
discovery.zen.ping.unicast.hosts: ["192.168.162.72"]
http.cors.enabled: true
http.cors.allow-origin: "*"

2、启动服务 -d 后台启动

./elasticsearch/bin/elasticsearch -d 

配置jvm.options

默认配置
-Xms2g
-Xmx2g
当系统内存不足时,需要调小这个值。否则启动多个节点时,由于内存不足,om会自动kill掉进程。
-Xms512m
-Xmx512m

配置elasticsearch-head(es可视化界面)

git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
npm install
npm run start
open http://localhost:9100/

注意:
 当启动主点后,端口9200和9300同时启动
9200作为Http协议,节点和外部通讯,调用restful接口用9200。
9300作为Tcp协议,ES集群节点之间的通讯使用。

文章链接: https://www.mfisp.com/20395.html

文章标题:ES集群构建(二)

文章版权:梦飞科技所发布的内容,部分为原创文章,转载请注明来源,网络转载文章如有侵权请联系我们!

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。

给TA打赏
共{{data.count}}人
人已打赏
建站教程

ES集群构建

2023-5-11 10:11:40

建站教程

linux mysql双主模式搭建

2023-5-12 10:28:29

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
客户经理
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索

梦飞科技 - 最新云主机促销服务器租用优惠