OS版本: CentOS 7.8
Elasticsearch版本:elasticsearch 7.2.1
vi /etc/security/limits.conf ---------------------------------------------- # 修改内容 * soft nproc 65535 * hard nproc 65535 * soft nofile 65535 * hard nofile 65535
vi /etc/security/limits.d/20-nproc.conf
----------------------------------------------------------
# 修改内容
* soft nproc 65565
----------------------------------------------------------
ulimit -Sn # 查看打开文件数软限制
ulimit -Hn # 查看打开文件数硬限制
ulimit -Su # 查看打开线程软限制
ulimit -Hu # 查看打开线程硬限制
vi /etc/sysctl.conf ------------------------------------------------- # 添加内容 vm.max_map_count=262144 ------------------------------------------------- sysctl -p # 验证
cd /opt wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.2.1-linux-x86_64.tar.gz tar -zxvf elasticsearch-7.2.1-linux-x86_64.tar.gz mv elasticsearch-7.2.1-linux-x86_64 elasticsearch
vi config/elasticsearch.yml ----------------------------------------------------- cluster.name: es-test node.name: node-1 path.data: /opt/elasticsearch/data path.logs: /opt/elasticsearch/logs network.host: 192.168.1.11 http.port: 9200 cluster.initial_master_nodes: ["node-1"] xpack.security.enabled: true xpack.security.transport.ssl.enabled: true
bin/elasticsearch -d
# 参数interactive:给用户一一设置密码,auto:自动生成密码
bin/elasticsearch-setup-passwords interactive
# 查看集群健康状态 curl -XGET -u elastic:password "http://192.168.100.11:9200/_cluster/health?pretty"
与单机模式一致。
cd /opt wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.2.1-linux-x86_64.tar.gz tar -zxvf elasticsearch-7.2.1-linux-x86_64.tar.gz mv elasticsearch-7.2.1-linux-x86_64 elasticsearch
# 如下操作在其中一个node节点执行即可,生成完证书传到集群其他节点目录/opt/elasticsearch/config # 两条命令均一路回车即可,不需要给秘钥再添加密码。 cd /opt/elasticsearch/config ../bin/elasticsearch-certutil ca ../bin/elasticsearch-certutil cert --ca elastic-stack-ca.p12
2.4 配置elasticsearch.yml
cluster.name: es-test node.name: node-1 path.data: /opt/elasticsearch/data path.logs: /opt/elasticsearch/logs network.host: 192.168.100.11 http.port: 9200 discovery.seed_hosts: ["192.168.100.11", "192.168.100.12", "192.168.100.13"] cluster.initial_master_nodes: ["node-1","node-2","node-3"] xpack.security.enabled: true xpack.security.transport.ssl.enabled: true xpack.security.transport.ssl.verification_mode: certificate xpack.security.transport.ssl.keystore.path: elastic-certificates.p12 xpack.security.transport.ssl.truststore.path: elastic-certificates.p12
bin/elasticsearch -d
# 参数interactive:给用户一一设置密码,auto:自动生成密码
bin/elasticsearch-setup-passwords interactive
# 查看集群健康状态 curl -XGET -u elastic:password "http://192.168.100.11:9200/_cluster/health?pretty"
原文:https://www.cnblogs.com/linwenhai/p/14618878.html