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の置き換え
- 古いpolicyをindexから除去
POST _plugins/_ism/remove/<index_name>
- 新しいpolicyを関連付け
POST _plugins/_ism/add/<index_name> { "policy_id": "<>policy_id" }
- 関連付け確認
POST _plugins/_ism/explain/<index_name>?show_policy=true
シャードレプリカ数の変更
PUT /<index_name>/_settings
{
"index": {
"number_of_replicas": <number_of_replicas>
}
}