linux环境下启动es时报错如下:

错误原因:

es因为安全问题拒绝使用root用户启动;

解决方法:

1.添加用户组:es,用户:es,she,设置密码

2.添加目录拥有权限

groupadd es 
useradd es -g es -p password # -g 指定组 -p 密码
chown es:es -R elasticsearch-7.10.0/ # -R 处理指定目录以及其子目录下的所有文件

3.切换到es用户,启动

su es

./elasticsearch

./elasticsearch -d # 后台方式启动

4.启动成功

 curl  127.0.0.1:9200
{
  "name" : "localhost.localdomain",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "QiU0NL7QRoqKJv7Wc4lcBQ",
  "version" : {
    "number" : "7.10.0",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "51e9d6f22758d0374a0f3f5c6e8f3a7997850f96",
    "build_date" : "2020-11-09T21:30:33.964949Z",
    "build_snapshot" : false,
    "lucene_version" : "8.7.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

Logo

更多推荐