我在环境中使用的以下示例数据
数据:
{ "index" : { "_index" : "cases", "_type" : "case", "_id" : "101" } }
{ "admission" : "2015-01-03", "discharge" : "2015-01-04", "injury" : "broken arm" }
{ "index" : { "_index" : "cases", "_type" : "case", "_id" : "102" } }
{ "admission" : "2015-01-03", "discharge" : "2015-01-06", "injury" : "broken leg" }
{ "index" : { "_index" : "cases", "_type" : "case", "_id" : "103" } }
{ "admission" : "2015-01-06", "discharge" : "2015-01-07", "injury" : "broken nose" }
{ "index" : { "_index" : "cases", "_type" : "case", "_id" : "104" } }
{ "admission" : "2015-01-07", "discharge" : "2015-01-07", "injury" : "bruised arm" }
{ "index" : { "_index" : "cases", "_type" : "case", "_id" : "105" } }
{ "admission" : "2015-01-08", "discharge" : "2015-01-10", "injury" : "broken arm" }
{ "index" : { "_index" : "patients", "_type" : "patient", "_id" : "101" } }
{ "name" : "Adam", "age" : 28 }
{ "index" : { "_index" : "patients", "_type" : "patient", "_id" : "102" } }
{ "name" : "Bob", "age" : 45 }
{ "index" : { "_index" : "patients", "_type" : "patient", "_id" : "103" } }
{ "name" : "Carol", "age" : 34 }
{ "index" : { "_index" : "patients", "_type" : "patient", "_id" : "104" } }
{ "name" : "David", "age" : 14 }
{ "index" : { "_index" : "patients", "_type" : "patient", "_id" : "105" } }
{ "name" : "Eddie", "age" : 72 }
将数据索引到节点中
$ curl -X POST 'http://localhost:9200/_bulk' --data-binary @./hospital.json
[2015-02-12 08:18:01,347][INFO ][shield.license ] [node0] enabling license for [shield]
[2015-02-12 08:18:01,347][INFO ][license.plugin.core ] [node0] license for [shield] - valid
[2015-02-12 08:18:01,355][ERROR][shield.license ] [node0]
#
# Shield license will expire on [Saturday, March 14, 2015]. Cluster health, cluster stats and indices stats operations are
# blocked on Shield license expiration. All data operations (read and write) continue to work. If you
# have a new license, please update it. Otherwise, please reach out to your support contact.
#
已安装Shield,并按照上述的要求启动
数据受到保护,如果我尝试访问,则可以看到以下内容。
$ curl localhost:9200/cases/case/101?pretty=true
{
"error" : "AuthenticationException[missing authentication token for REST request [/cases/case/1]]",
"status" : 401
}
用户和角色如下添加
$ elasticsearch/bin/shield/esusers useradd alice -r nurse
$ elasticsearch/bin/shield/esusers useradd bob -r doctor
我已经编辑了role.yml并尝试根据上述示例添加医生和护士。安全性对我不起作用。
ubuntu@ip-10-142-247-183:~/elkproject/elasticsearch-1.4.4/config/shield$ curl --user alice:abc123 localhost:9200/_count?pretty=true
{
"error" : "AuthenticationException[unable to authenticate user [alice] for REST request [/_count?pretty=true]]",
"status" : 401
}
注意:我提到了这个博客http://blog.trifork.com/2015/03/05/shield-your-kibana-dashboards/
任何帮助将不胜感激
最佳答案
您是否从软件包(例如RPM或DEB)安装了elasticsearch?如果是这样,则esusers工具可能存在问题,将用户放置在错误的位置。现在,您必须使用正确的位置configure your environment并添加用户。在这种情况下,可以将$ ES_HOME / config / shield目录移动到/ etc / elasticsearch,这是RPM和DEB安装的默认配置目录。将来在使用esusers命令时,只需确保如链接所示设置环境变量即可。
您也可以删除Shield并按照完整的getting started guide重新开始安装,然后按照博客中的说明开始修改文件。删除现有的Shield安装:bin/plugin -r shield
关于elasticsearch - 尝试使用Shield将Shield搜索到kibana仪表板遇到错误?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/29702289/