分发需在linux中再配置一下,不会的可以去看一下我的另一篇博客linux系统同步分发xsync配置
xsync es-cluster server 2 33. 创建es用户
因为安全问题,easticsearch不允许root用户直接运行,所以要在每个节点中创建新用户,在root用户中创建新用户
useradd es #新增es用户 passwd es #为es用户设置密码 userdel -r es #如果错了,可以删除再加 chown -R es:es /usr/local/es-cluster #文件所有者4. 修改配置文件
修改/usr/local/es-cluster/config/elasticsearch.yml文件,分发文件
#在文件末尾中增加下面内容 es soft nofile 65536 es hard nofile 655365.2修改/etc/security/limits.d/20-nproc.conf,分发文件
#在文件末尾中增加下面内容 es soft nofile 65536 es hard nofile 65536 * hard nproc 4096 #注:*代表linux所有用户名称5.3修改/etc/sysctl.conf
#在文件中增加下面内容 vm.max_map_count=655360
重新加载
sysctl -p6. 启动软件
分别在不同节点上启动ES软件
cd /usr/local/es-cluster
#启动
bin/elasticsearch
#后台启动
bin/elasticsearch -d
依次启动elasticsearch的各个节点,启动过程如下
从postman中看启动结果
另外,如有不懂,可以加我微信muok123456789,一起学习。



