elasticsearch 集群部署,版本 5.5.0

准备说明:

两台服务器 Ip分别为 192.168.239.78(主),192.168.239.49(从)

主服务器上配置如下:
1.上传es5.5.0版本至主服务器
2.解压 unzip
unzip elasticsearch-5.5.0.zip
3.进入config 目录
4.修改elasticsearch.yml
cluster.name: elasticsearch
node.name: node-1
node.master: true
discovery.zen.ping.unicast.hosts: ["192.168.239.78","192.168.239.49"]
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
network.host: 0.0.0.0
http.port: 9200
其他的保持默认
5.保存退出,进入bin目录./elasticsearch 启动服务
服务没有退出表示正常。
6. 192.168.239.78:9200 查看是否正常。

从服务器上部署如下:

1.上传es5.5.0版本至从服务器
2.解压 unzip
unzip elasticsearch-5.5.0.zip
3.进入config 目录
4.修改elasticsearch.yml
cluster.name: elasticsearch
node.name: node-2
node.master: true
discovery.zen.ping.unicast.hosts: ["192.168.239.78","192.168.239.49"]
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
network.host: 0.0.0.0
http.port: 9200
其他的保持默认
5.保存退出,进入bin目录./elasticsearch 启动服务
服务没有退出表示正常。
6. 192.168.239.49:9200 查看是否正常。

问题汇总

1.max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
解决方案:/etc/sysctl.conf文件最后添加一行vm.max_map_count=262144

2.max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]
解决方案:/etc/security/limits.conf 增加
* - nofile 65536
* - memlock unlimited

数据迁移:

https://blog.csdn.net/qq_21873747/article/details/79658200

https://www.cnblogs.com/hxlasky/p/11687318.html

原文地址:https://www.cnblogs.com/baoyi/p/elasticsearch_master_cluster.html