elasticsearch启动常见错误

编程入门 行业动态 更新时间:2024-10-27 22:20:29

原文链接:https://wwwblogs/zhi-leaf/p/8484337.html

文章目录

  • 问题出现环境,OS版本:CentOS-7-x86_64;ES版本:elasticsearch-7.13
  • Q1:max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
  • Q2:max number of threads [3818] for user [es] is too low, increase to at least [4096]
  • Q3:max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
  • Q4:Exception in thread "main" java.nio.file.AccessDeniedException: /usr/local/elasticsearch/elasticsearch-7.13/config/jvm.options
  • Q5: 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
  • Q6:es集群启动完成后浏览器输入/_cat/nodes?pretty报master_not_discovered_exception

问题出现环境,OS版本:CentOS-7-x86_64;ES版本:elasticsearch-7.13

Q1:max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

  1. max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

    每个进程最大同时打开文件数太小,可通过下面2个命令查看当前数量

    ulimit -Hn
    ulimit -Sn
    

    修改/etc/security/limits.conf文件,增加配置,用户退出后重新登录生效

    *               soft    nofile          65536
    *               hard    nofile          65536
    

Q2:max number of threads [3818] for user [es] is too low, increase to at least [4096]

  1. max number of threads [3818] for user [es] is too low, increase to at least [4096]

    问题同上,最大线程个数太低。修改配置文件/etc/security/limits.conf(和问题1是一个文件),增加配置

    	*               soft    nproc           4096
    	*               hard    nproc           4096
    

    可通过命令查看

    	ulimit -Hu
    	ulimit -Su
    

    修改后的文件:

    *               soft    nofile          65536
    *               hard    nofile          65536
    *               soft    nproc           4096
    *               hard    nproc           4096
    

Q3:max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

  1. max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

    修改/etc/sysctl.conf文件,增加配置vm.max_map_count=262144

    vi /etc/sysctl.conf
    sysctl -p
    

    执行命令sysctl -p生效

Q4:Exception in thread “main” java.nio.file.AccessDeniedException: /usr/local/elasticsearch/elasticsearch-7.13/config/jvm.options

  1. Exception in thread “main” java.nio.file.AccessDeniedException: /usr/local/elasticsearch/elasticsearch-7.13/config/jvm.options

    elasticsearch用户没有该文件夹的权限,执行命令

    chown -R es:es /usr/local/elasticsearch/

Q5: 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

原文链接: https://blog.csdn/qq_43655835/article/details/104637625

在elasticsearch的config目录下,修改elasticsearch.yml配置文件,将下面的配置加入到该配置文件中:

ip替换host1等,多节点请添加多个ip地址,单节点可写按默认来
#配置以下三者,最少其一
#[discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes]
cluster.initial_master_nodes: ["node-1"] #这里的node-1为node-name配置的值

Q6:es集群启动完成后浏览器输入/_cat/nodes?pretty报master_not_discovered_exception

原文链接:https://yanglinwei.blog.csdn/article/details/105274464

es集群启动后,在浏览器输入:http://es ip地址:端口/_cat/nodes?pretty,会提示如下错误:
{ "error" : { "root_cause" : [ { "type" : "master_not_discovered_exception", "reason" : null } ], "type" : "master_not_discovered_exception", "reason" : null }, "status" : 503 }

解决方案:
在每个配置文件指定初始节点:

cluster.initial_master_nodes: node-1


重启ES集群,浏览器再次输入http://es ip地址:端口/_cat/nodes?pretty,就可以看到集群启动成功了:

更多推荐

elasticsearch启动常见错误

本文发布于:2023-06-14 02:20:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1427300.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:常见   错误   elasticsearch

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!