Centos7安装elasticsearch7.14.0遇到问题(无法远程访问;内存小;bootstrap checks failed)

本文档详细介绍了在CentOS7上安装Elasticsearch7.14.0时遇到的四个主要问题及其解决方法:1)无法远程访问,需要修改`elasticsearch.yml`配置文件并检查防火墙设置;2)系统虚拟内存限制过低,需调整`vm.max_map_count`参数;3)最大文件描述符数量不足,需要在`limits.conf`中设置软硬限制;4)启动时bootstrap checks失败,需配置`discovery.seed_hosts`等参数。通过这些步骤,可以成功解决安装和运行Elasticsearch时的常见问题。

Centos7安装elasticsearch7.14.0遇到问题(无法远程访问;内存小;bootstrap checks failed)

问题1:无法远程访问

es解决方法

vim elasticsearch.yml 将原来network修改为以下配置:

network.host: 0.0.0.0

原因2:防火墙原因

解决方法:停止防火墙 或开放5601端口

#查询防火墙状态,是否开启着

systemctl status firewalld

 #停止防火墙

$service firewalld stop

其他防火墙命令:
1、查看firewall服务状态
systemctl status firewalld
出现Active: active (running)切高亮显示则表示是启动状态。
出现 Active: inactive (dead)灰色表示停止。
2、查看firewall的状态
firewall-cmd --state
3、开启、重启、关闭、firewalld.service服务
# 开启
service firewalld start
# 重启
service firewalld restart
# 关闭
service firewalld stop
4、查看防火墙规则
firewall-cmd --list-all
5、查询、开放、关闭端口
# 查询端口是否开放
firewall-cmd --query-port=8080/tcp
# 开放80端口
firewall-cmd --permanent --add-port=80/tcp
# 移除端口
firewall-cmd --permanent --remove-port=8080/tcp
#重启防火墙(修改配置后要重启防火墙)
firewall-cmd --reload

# 参数解释
1、firwall-cmd:是Linux提供的操作firewall的一个工具;
2、--permanent:表示设置为持久;
3、--add-port:标识添加的端口;

问题2:ES启动时出现异常报错:max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

原因:系统虚拟内存默认最大映射数为65530,无法满足ES系统要求,需要调整为262144以上。

解决方法:root用户设置vm.max_map_count参数

#修改文件

vim /etc/sysctl.conf

#添加参数

...

vm.max_map_count = 262144

#重新加载/etc/sysctl.conf配置

sysctl -p 立即生效

或/sbin/sysctl -p

问题3:max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]

ERROR: [1] bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch.
bootstrap check failure [1] of [1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]


解决办法:

1、将当前用户的软硬限制调大。找到文件 /etc/security/limits.conf,编辑,在文件的最后追加如下配置:

2、来回切换用户,root修改后切换到es,使之生效

 说明: soft nofile表示软限制,hard nofile表示硬限制。两行语句表示,es用户的软限制为65535,硬限制为65537,即表示es用户能打开的最大文件数量为65537,不管它开启多少个shell。

问题4:ES启动时出现异常报错bootstrap checks failed

[1] bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch.

bootstrap check failure [1] of [1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured

翻译:在discovery.seed_hosts,discovery.seed_providers, cluster.initial_master_nodes中至少设置一项。

解决方法:修改elasticsearch.yml配置文件,并重启es

vim elasticsearch.yml

network.host: 0.0.0.0

node.name: node-1

cluster.initial_master_nodes: ["node-1"]

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

宁儿测试开发

您的鼓励是我创作的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值