es7.13.2集群安装失败报错处理

ERROR: [2] bootstrap checks failed.You must address the points described in the following [2] lines before starting Elasticsearch.
bootstrap checks failed [1] of [2]: memory locking requested for elasticsearch process but memory is not locked
bootstrap checks failed [1] of [2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least  [262144]
ERROR: Elasticsearch did not exit normally - check the logs at /a/es/logs/cluster.log

系统:centos7.6 (vm虚拟机)

软件:java-1.8、elasticsearch-5.6.16-1.noarch

错误信息:

[2019-11-21T00:29:51,557][ERROR][o.e.b.Bootstrap          ] [elk-1] node validation exception
[1] bootstrap checks failed
[1]: memory locking requested for elasticsearch process but memory is not locked
 

解决方法一(关闭bootstrap.memory_lock:,会影响性能):

vim /etc/elasticsearch/elasticsearch.yml // 设置成false就正常运行了。

bootstrap.memory_lock: false

解决方法二(开启bootstrap.memory_lock:):

  1. 修改文件/etc/elasticsearch/elasticsearch.yml,上面那个报错就是开启后产生的,如果开启还要修改其它系统配置文件
bootstrap.memory_lock: true
  1. 修改文件/etc/security/limits.conf,最后添加以下内容。
vim /etc/security/limits.conf 
* soft nofile 65536

* hard nofile 65536

* soft nproc 32000

* hard nproc 32000

* hard memlock unlimited

* soft memlock unlimited
  1. 修改文件 /etc/systemd/system.conf ,分别修改以下内容。
DefaultLimitNOFILE=65536

DefaultLimitNPROC=32000

DefaultLimitMEMLOCK=infinity

改好后重启下系统。再启动elasticsearch就没报错了 。

es7.13.2启动报错:
bootstrap checks failed [1] of [2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

vim /etc/sysctl.conf

vm.max_map_count=262144

sysctl -p

集群配置

cluster.name: clustername
node.name: nodename1
path.data: data
path.logs: logs
network.host: "0.0.0.0"
http.port: 9200
discovery.seed_hosts: ["ip1", "ip2", "ip3"]
cluster.initial_master_nodes: ["ip1", "ip2", "ip3"]
xpack.security.enabled: true
xpack.license.self_generated.type: basic
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
#xx代表config目录下的xx目录
xpack.security.transport.ssl.keystore.path: xx/elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: xx/elastic-certificates.p12

生成证书步骤

  1. 使用命令
./elasticsearch-certutil ca 

生成名为 elastic-stack-ca.p12 的 CA 文件,密码留空。

  1. 使用命令
./elasticsearch-certutil cert --ca elastic-stack-ca.p12

为节点颁发证书,生成名为 elastic-certificates.p12 的证书,
过程中直接按 Enter 即可,输出文件包含节点证书、节点密钥和 CA 证书。

es设置密码:

./elasticsearch-setup-passwords interactive

系统启动

/path/to/your/elasticsearch 为es安装目录

[Unit]
Description=Elasticsearch

[Service]
WorkingDirectory=/path/to/your/elasticsearch
Environment=ES_HOME=/path/to/your/elasticsearch
Environment=ES_CONFIG=/path/to/your/elasticsearch/config
Environment=PID_DIR=/var/run/elasticsearch
EnvironmentFile=-/etc/default/elasticsearch
ExecStart=/path/to/your/elasticsearch/bin/elasticsearch
ExecStop=/path/to/your/elasticsearch/bin/elasticsearch-stop
ExecReload=/bin/kill -HUP $MAINPID
User=elasticsearch
Restart=always

[Install]
WantedBy=default.target
  • 6
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值