IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    elasticsearch不能用root用户运行

    村里来的扫地僧发表于 2016-03-29 04:41:05
    love 0
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    
    [root@localhost bin]# ./elasticsearch -d
    [root@localhost bin]# Exception in thread "main" java.lang.RuntimeException: don't run elasticsearch as root.
    	at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:93)
    	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:144)
    	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:285)
    	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
    Refer to the log for complete error details.
    创建elk用户:elk:x:500:500::/home/elk:/bin/bash
    赋予权限:
     
    [root@localhost opt]# chown -R elk.elk elasticsearch-2.2.1
    切换elk帐户:
     
    [root@localhost elasticsearch-2.2.1]# su elk
    启动elasticsearch:
     
    [elk@localhost bin]$ ./elasticsearch -d
    检查是否启动:[elk@localhost bin]$ curl -XGxt http://localhost:9200/
    {
      "name" : "Iron Man",
      "cluster_name" : "elasticsearch",
      "version" : {
        "number" : "2.2.1",
        "build_hash" : "d045fc29d1932bce18b2e65ab8b297fbf6cd41a1",
        "build_timestamp" : "2016-03-09T09:38:54Z",
        "build_snapshot" : false,
        "lucene_version" : "5.4.1"
      },
      "tagline" : "You Know, for Search"
    }


沪ICP备19023445号-2号
友情链接