linux服务器配置要求:
/etc/sysctl.conf文件最后添加一行
vm.max_map_count=262144 /etc/sysctl.conf /sbin/sysctl -p
修改文件/etc/security/limits.conf,最后添加以下内容。
soft nofile 65536 hard nofile 65536 soft nproc 32000 hard nproc 32000 hard memlock unlimited soft memlock unlimited
修改文件 /etc/systemd/system.conf ,分别修改以下内容。
DefaultLimitNOFILE=65536 DefaultLimitNPROC=32000 DefaultLimitMEMLOCK=infinity
es版本为7.9.0
部署步骤:
1 在linux服务器创建用户组
命令:groupadd -g 888 es
2 在linux服务器创建用户
命令:useradd -g es es
3 将文件es.zip上传服务器/opt/目录并解压,建议放在/opt/,es.zip压缩包内涉及到这个路径的配置挺多.
4 更改es文件夹所有者权限—->es
命令:chown -R es:es es
5 切换到es用户
命令:su es
6 编辑eselasticsearch-7.9.0configelasticsearch.yml
cluster.name: idoc-es 集群名
node.name: es-01 节点名
path.data: /opt/es/elasticsearch-6.2.2/path/to/data 数据存储路径
path.logs: /opt/es/elasticsearch-6.2.2/path/to/logs 日志存储路径
network.host: xx.xx.xx.xx 绑定当前服务器ip
discovery.zen.ping.unicast.hosts: ["xx.xx.xx.xx :9300", "xx.xx.xx.xx :9300", "xx.xx.xx.xx :9300"] 集群ip
7 elasticsearch-7.9.0binelasticsearch为启动文件(es用户启动) 命令ll查看elasticsearch操作权限若无可执行权限
命令:chmod 777 elasticsearch
8 ./elasticsearch -d 后台运行es
9 查看日志命令:
tail -f -n 200 /opt/es/elasticsearch-6.2.2/path/to/logs/idoc-es.log
es数据安全策略插件x-pack启用
1 生成节点证书
借助elasticsearch-certutil命令生成证书:
bin/elasticsearch-certutil.bat ca -out config/elastic-certificates.p12 -pass “”
生成的证书config/elastic-certificates.p12需要copy到所有节点的同样位置
2 设置密码
bin/elasticsearch-setup-passwords interactive



