【发布时间】:2016-07-16 09:27:25
【问题描述】:
我正在尝试使用弹性云托管的弹性搜索服务https://www.elastic.co/cloud
我正在使用 python 和 elasticsearch-py 包来连接我的 flaks 应用程序:
es_connection = Elasticsearch(
["https://myuser:mysecret@xxxxxxx.us-west-1.aws.found.io:9243"]
)
es_connection.indices.create(index="myindex", ignore=400, body=mapping_dict)
但我不断收到此错误:
08:55:56,240 elasticsearch DEBUG < {"error":{"root_cause":[{"type":"security_exception","reason":"action [indices:admin/create] is unauthorized for user [myuser]"}],"type":"security_exception","reason":"action [indices:admin/create] is unauthorized for user [myuser]"},"status":403}
在盾牌编辑器中,我为这些用户设置了这个角色:
admin: admin
myuser: admin
这些角色在编辑器中定义为 // 这是所有角色的编辑器。 // 以下是一些示例角色。要实际使用角色,请在上述编辑器中映射用户。
// 管理员无所不能
admin:
cluster: all
indices:
'*': all
这意味着,myuser 被设置为admin 角色,所以它应该能够创建索引..对吗?那我为什么会出错呢?
【问题讨论】:
标签: python elasticsearch elasticsearch-2.0