• 【解决】ElasticsearchException[failed to bind service]; nested: AccessDeniedException[/usr/share/elasticsearch/data/nodes]


    【问题一】使用helm安装Elasticsearch时提示权限不够

    [root@k8s-master elasticsearch]# kubectl logs elasticsearch-master-0 -n efk
    OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
    {"type": "server", "timestamp": "2020-03-01T09:01:32,837Z", "level": "ERROR", "component": "o.e.b.ElasticsearchUncaughtExceptionHandler", "cluster.name": "elasticsearch", "node.name": "elasticsearch-master-0", "message": "uncaught exception in thread [main]",
    "stacktrace": ["org.elasticsearch.bootstrap.StartupException: ElasticsearchException[failed to bind service]; nested: AccessDeniedException[/usr/share/elasticsearch/data/nodes];",
    "at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:174) ~[elasticsearch-7.6.0.jar:7.6.0]",
    "at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161) ~[elasticsearch-7.6.0.jar:7.6.0]",
    "at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-7.6.0.jar:7.6.0]",
    "at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:125) ~[elasticsearch-cli-7.6.0.jar:7.6.0]",
    "at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-7.6.0.jar:7.6.0]",
    "at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126) ~[elasticsearch-7.6.0.jar:7.6.0]",
    "at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-7.6.0.jar:7.6.0]",
    "Caused by: org.elasticsearch.ElasticsearchException: failed to bind service",

    【分析】

      这是由于PV挂载目录权限不够导致,特别是HostPath类型,挂载在宿主机上的PV,很多时候会忘记赋予权限。

    【解决】

      找到PV对应服务器上的目录,更改权限即可(chmod -R 777 els)。

  • 相关阅读:
    linux编程 给线程起名字
    c语言的__packed__
    LINUX 命令行编辑快捷键
    linux关于bashrc与profile的区别(转)
    linux查看和修改PATH环境变量的方法
    linux 线程 pthread_create 源码 剖析
    你真的了解【HashMap】么?-一
    Oracle 基础概念
    Java数据库连接池
    JVM内存模型与垃圾回收
  • 原文地址:https://www.cnblogs.com/leozhanggg/p/12390850.html
Copyright © 2020-2023  润新知