_cluster/settingでbodyの内容をPUTすることができないのはなぜですか。

0

事前学習済みモデルを利用してsemantic search機能を作成しようとしています。 次のページを参考にしています。https://opensearch.org/docs/latest/ml-commons-plugin/semantic-search/

ページのPrerequisitesの部分で、

PUT _cluster/settings
{
  "persistent": {
    "plugins": {
      "ml_commons": {
        "only_run_on_ml_node": "false",
        "model_access_control_enabled": "true",
        "native_memory_threshold": "99"
      }
    }
  }
}

を実施してみたのですが、 次のようなエラーが返ってきます。

{
    "Message": "Your request: '/_cluster/settings' payload is not allowed."
}

ちなみに、GET _cluster/settings は何の問題もなく返信が来ます。

--------2023/11/29 16:16(進捗)-----------------------------------------------------------------------

https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-settings/ 以上のページで次のような記述を発見。

Request fields
The GET operation has no request body options. All cluster setting field parameters are optional.

Not all cluster settings can be updated using the cluster settings API. You will receive the error message "setting [cluster.some.setting], not dynamically updateable" when trying to configure these settings through the API.

For a listing of all cluster settings, see Configuring OpenSearch.

Configuring Opensearchを調査中...

yuuka_u
已提問 5 個月前檢視次數 346 次
1 個回答
0
已接受的答案

答えを見つけることができました。 解決策はこちらのページに従いました。 https://docs.aws.amazon.com/opensearch-service/latest/developerguide/supported-operations.html#version_api_notes

ページには

The high-level Java REST client uses the expanded form, so if you need to send settings requests, use the low-level client.

と記載。

うまくいかない例

PUT _cluster/settings
{
  "persistent": {
    "plugins": {
      "ml_commons": {
        "only_run_on_ml_node": "false",
        "model_access_control_enabled": "true",
        "native_memory_threshold": "99"
      }
    }
  }
}

うまくいった例

PUT _cluster/settings
{
  "persistent": {
      "plugins.ml_commons.only_run_on_ml_node": "false",
      "plugins.ml_commons.model_access_control_enabled": "true",
      "plugins.ml_commons.native_memory_threshold": "99"
    }
  }

うまくいった例で実行したところ、_cluster/settingに追加することができました。

yuuka_u
已回答 5 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南

相關內容