【问题标题】:Elastic cloud - unable to create index弹性云 - 无法创建索引
【发布时间】: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


    【解决方案1】:

    我通过将两个用户名放在同一行来修复它。像这样:

    admin: admin, myuser

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-09-06
      • 2019-09-28
      • 2022-08-17
      • 2018-05-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多