1
我想使用彈性雲託管elasticsearch服務https://www.elastic.co/cloud彈性雲 - 無法創建索引
我使用Python和elasticsearch-PY包在我flaks應用程序連接:
es_connection = Elasticsearch(
["https://myuser:[email protected]: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
作用,所以應該能夠創建index..right?那麼爲什麼我會出錯?