_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
posta 5 mesi fa346 visualizzazioni
1 Risposta
0
Risposta accettata

答えを見つけることができました。 解決策はこちらのページに従いました。 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
con risposta 5 mesi fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande