相关内容下载:
1、服务器环境准备
服务器A:公网IP[ip1],非root用户[elastic1],运行路径[path1]
服务器B:公网IP[ip2],非root用户[elastic2],运行路径[path2]
2、配置文件修改
vi [path1]/elasticsearch-6.3.1/config/elasticsearch.yml
network.host: 0.0.0.0
network.publish_host: [ip1]
discovery.zen.ping.unicast.hosts: ["[ip1]","[ip2]"]
cluster.name: mycluster
node.name: NODE1
node.master: true
node.data: true
discovery.zen.minimum_master_nodes: 1
vi [path2]/elasticsearch-6.3.1/config/elasticsearch.yml
network.host: 0.0.0.0
network.publish_host: [ip2]
discovery.zen.ping.unicast.hosts: ["[ip1]","[ip2]"]
cluster.name: mycluster
node.name: NODE1
node.master: false
node.data: true
discovery.zen.minimum_master_nodes: 1
3、启动elasticsearch
服务器A:
cd [path1]/elasticsearch-6.3.1
./bin/elasticsearch
服务器B:
cd [path2]/elasticsearch-6.3.1
./bin/elasticsearch
4、启动kibana
服务器A:
cd [path1]/kibana-6.3.1-linux-x86_64
./bin/kibana
遇到的问题:
- don’t run elasticsearch as root.
1、切换到非root用户
2、chown -R [用户] ./elasticsearch
- [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
1、切换为root用户
2、vi /etc/sysctl.conf
增加
fs.file-max=655350
vm.max_map_count=655360
3、vi /etc/security/limits.conf
增加
soft nofile 655350
hard nofile 655350
4、sysctl -p
- elasticsearch 无法启动直接killed
内存不足,修改ES的虚拟内存
1、vi ./bin/elasticsearch
ES_JAVA_OPTS=”-Xms512m -Xmx512m”
- Exception in thread “main” java.nio.file.AccessDeniedException
chown -R [用户] ./elasticsearch
- not enough master nodes discovered during pinging (found [[]], but needed [-1]), pinging again
因为使用的是云服务器,有内网ip和外网ip,需要指定配置文件中network.publish_host
为外网ip。
Everything is very open with a really clear explanation of the issues. Corrina Milt Ailene
You made various fine points there. I did a search on the subject and found nearly all persons will agree with your blog. Wynn Ewart Loesceke
There is definately a great deal to find out about this topic. I like all the points you made. Saraann Natal Derwon
Well I truly liked reading it. This information provided by you is very constructive for proper planning. Elita Billie Lundgren
As I website possessor I believe the content matter here is rattling excellent , appreciate it for your hard work. Benedikta Vasily Hilbert
I pay a visit every day some web sites and information sites to read posts, except this webpage provides feature based content. Bree Cullin Anastas
I have read so many articles about the blogger lovers however this article is truly a fastidious post, keep it up. Germana Bay Beaner