如何解决弹性搜索中的AccessDeniedException? [英] How to solve AccessDeniedException in elasticsearch?

查看:3119
本文介绍了如何解决弹性搜索中的AccessDeniedException?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我有两个帐户mac,一个是原来的,另一个是新创建的都是管理类型

 原始帐号是= Jack 

新创建的是= Snooke

当我在终端上输入 elasticsearch 时,我的帐户是正常的



但是当我输入我收到这个错误

 线程mainjava.lang中的异常。 IllegalStateException:创建节点环境失败
可能的根本原因:java.nio.file.AccessDeniedException:/ usr / local / var / elasticsearch / elasticsearch_jack / nodes / 1
pre>

好像Snooke正在尝试访问Jack的弹性搜索文件夹?



我该如何解决?

解决方案

在我的Mac用户拥有管理员权限在组员工。问题是,弹性搜索将数据文件夹中的文件夹写入权限 r-x 。因此,该组的其他成员没有这些文件夹的写入权限。您可以通过执行某些类似chmod -R 775来更改所有文件夹的访问权限。但是我认为,每创建一个新的文件夹,您将面临同样的问题。



这个问题只在那里,如果你想继续使用两个帐户的数据。如果您只想使用新帐户,可以进入弹性搜索文件夹,然后执行以下操作:(注意'。'结尾)

  chown -R Snooke:工作人员。 


Currently I have two accounts on mac, one is the original and the other one is the newly created both are admin type

Original account name is  = Jack

Newly created is = Snooke

In Jack account when I type in elasticsearch on the terminal its working fine

But when i type elasticsearch on Snooke's terminal I received this error

Exception in thread "main" java.lang.IllegalStateException: Failed to created node environment
Likely root cause: java.nio.file.AccessDeniedException: /usr/local/var/elasticsearch/elasticsearch_jack/nodes/1

It seems like Snooke is trying to access Jack's elastic search folder?

How do I solve this?

解决方案

On my Mac users with admin rights are in the group staff. Problem is that elasticsearch writes folders in the data folder with the rights r-x. So other members of the group do not have write access to these folders. You could change these access rights for all the folders by doing some like chmod -R 775. But I think that with every new folder that is created you would face the same problems.

This problem is only there if you want keep using the data with both accounts. If you just want to use the new account you could go to the elasticsearch folder and do: (Notice the '.' at the end)

chown -R Snooke:staff .

这篇关于如何解决弹性搜索中的AccessDeniedException?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆