提问者:小点点

Opensearch由于没有权限,无法设置副本数


我在为新索引运行索引管理策略时遇到问题。我在“设置number_of_replicas”步骤中遇到以下错误:

{
  "cause": "no permissions for [indices:admin/settings/update] and associated roles [index_management_full_access, own_index, security_rest_api_access]",
  "message": "Failed to set number_of_replicas to 2 [index=sample.name-2022.10.22]"
}

索引是由使用"sample.name-YYYY.MM. DD"名称模板的logstash创建的,因此在索引策略中我有"sample.name-*"索引模式。

我的政策:

{
    "policy_id": "sample.name-*",
    "description": "sample.name-* policy ",
    "schema_version": 16,
    "error_notification": null,
    "default_state": "set replicas",
    "states": [
        {
            "name": "set replicas",
            "actions": [
                {
                    "replica_count": {
                        "number_of_replicas": 2
                    }
                }
            ]
    ],
    "ism_template": [
        {
            "index_patterns": [
                "sample.name-*"
            ],
            "priority": 1
        }
    ]
}

我不明白这个错误的原因。我做错了什么吗?

重试策略不起作用。只有当我手动将策略重新分配到仪表板或API索引时,策略才起作用。

Opensearch版本:2.3.0


共1个答案

匿名用户

我第一次使用自定义内部用户下的API创建策略,仅映射“security_rest_api_access”安全角色。

所以我添加了all_access权限,我的内部用户和重新创建的政策,它的工作原理!

似乎该策略在我的内部用户下运行,创建它