刚刚安装的elasticsearch启动报错

  查看日志/var/log/message

Sep 27 11:13:17 local-nginx elasticsearch: Exception in thread "main" org.elasticsearch.bootstrap.BootstrapException: org.elasticsearch.cli.UserException: unable to create temporary keystore at [/etc/elasticsearch/elasticsearch.keystore.tmp], please check filesystem permissions

   原因:第一次启动需要创建keystore文件,但是配置文件路径/etc/elasticsearch/ 没有权限

  设置权限

 chown -R elasticsearch:elasticsearch /etc/elasticsearch/

   再重启即可

 systemctl restart elasticsearch

   PS:之前安装elasticsearch无需手动设置该权限