0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

OpenSearch コマンド集(Ops)

Posted at

OpenSearchダッシュボード上でなにかと役立つコマンド集

Dev Tools を開く

OpenSearchのハンバーガーメニュー(「≡」のマーク)からメニューを展開し、 Dev Tools を開く

コマンド集

基本コマンド

ステータス一覧

GET _stats

ライフサイクル関連

warm storageにあるindex一覧

GET _warm

cold storageにあるindex一覧

GET _cold/indices/_search

shard数, hot instanceのストレージが100%に近いとき

hot instance → warm storage へのindex移動

POST _ultrawarm/migration/<index_name>/_warm

warm → cold storageへindexを移動

POST _ultrawarm/migration/<index_name>/_cold?ignore=timestamp

移動中のindexとステータス

GET _ultrawarm/migration/migration/_status?v

TroubleShooting

Indexのヘルスチェック。yellow or red なら注意

GET _cat/indices?v&s=health

シャード未割当てのindex一覧

GET _cat/shards?v&h=index,shard,prirep,state,unassigned.reason | grep UNASSIGNED

シャードが未割当ての理由の詳細

GET _cluster/allocation/explain?pretty
{
  "index": "<index_name>",
  "shard": <shards_id>,
  "primary": <true or false>
}

troubleshootig後

ISM policy変更後、既存indexのISM policyの置き換え

  1. 古いpolicyをindexから除去
    POST _plugins/_ism/remove/<index_name>
    
  2. 新しいpolicyを関連付け
    POST _plugins/_ism/add/<index_name>
    {
      "policy_id": "<>policy_id"
    }
    
  3. 関連付け確認
    POST _plugins/_ism/explain/<index_name>?show_policy=true
    

シャードレプリカ数の変更

PUT /<index_name>/_settings
{
  "index": {
    "number_of_replicas": <number_of_replicas>
  }
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?