elasticsearch集群安装
程序员文章站
2024-02-25 14:47:45
...
3台机器elasticsearch集群
所需软件:
1.jdk8
2.elasticsearch6.3.2
3.elasticsearch-head
在安装elasticsearch之前,先安装jdk1.8。
集群规划
主机名 | 角色 | 备注 |
---|---|---|
192.168.68.128 | 主节点 | node-1 |
192.168.68.128 | 从节点 | node-2 |
192.168.68.128 | 从节点 | node-3 |
一、下载解压安装包
tar -zxvf elasticsearch-6.3.2.tar.gz -C /usr/local/modules/
二、编辑 vim elasticsearch.yml文件
cluster.name: my-application
node.name: node-1
node.master: true
network.host: 192.168.68.128
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
http.port: 9201
discovery.zen.ping.unicast.hosts: ["192.168.68.128"]
http.cors.enabled: true
http.cors.allow-origin: "*"
三、启动es会报错
[2020-10-28T04:54:00,395][INFO ][o.e.b.BootstrapChecks ] [node-1] bound or publishing to a non-loopback address, enforcing bootstrap checks
ERROR: [2] bootstrap checks failed
[1]: max number of threads [1024] for user [es] is too low, increase to at least [4096]
[2]: system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
[2020-10-28T04:54:00,411][INFO ][o.e.n.Node ] [node-1] stopping ...
[2020-10-28T04:54:00,462][INFO ][o.e.n.Node ] [node-1] stopped
[2020-10-28T04:54:00,462][INFO ][o.e.n.Node ] [node-1] closing ...
[2020-10-28T04:54:00,496][INFO ][o.e.n.Node ] [node-1] closed
解决方案
max number of threads
vim /etc/security/limits.conf
* soft nproc 65536
* hard nproc 65536
* soft nofile 65536
* hard nofile 65536
vim /etc/security/limits.d/90-nproc.conf
soft nproc 2048
vm.max_map_count
vi /etc/sysctl.conf
vm.max_map_count=262144
保存后再执行下面命令
sysctl -p
system call filters
vim elasticsearch.yml
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
四、分别启动三个elasticsearch
启动命令
./bin/elasticsearch
五、访问
http://192.168.68.128:9201/
上一篇: webstrom下运行gulp初试
下一篇: ADC0809模数转换