问题现象: elasticsearch配置network.host: 0.0.0.0导致elasticsearch服务启动不成功的问题,端口未启动
排查思路: 进入elasticsearch下有个logs文件夹,查看elasticsearch.log日志文件,发现以下报错 - [1] bootstrap checks failed
- [2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
- [3]: 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
复制代码
解决方案: 问题[2] - 1、临时修改(不会在重启后保留):
- sudo sysctl -w vm.max_map_count=262144
- 2、永久修改
- 编辑/etc/sysctl.conf文件,添加以下行:
- vm.max_map_count=262144
- 然后运行以下命令来使改动立即生效:
- sudo sysctl -p
复制代码
问题[3] 在elasticsearch/elasticsearch-7.6.0/config/elasticsearch.yml 文件,添加一下行即可解决 - cluster.initial_master_nodes: ["node-1"]
复制代码
|