Elasticsearch開発元がライセンス変更したので、AWSがforkしてOpenSearchになった。
Source data * (1 + number of replicas) * 1.45 = minimum storage requirement
minimum storage requirement / number of data node = storage on data node
m5.large.search = max 512GB
os_endpoint=https://search-access2-edwtfevernq4kklyjrdkx7hwti.ap-northeast-1.es.amazonaws.com index=prod-access-2023-04-10 curl -s $os_endpoint/$index/_settings?pretty | jq -r '. | map(select(.settings))[] | .settings.index.number_of_replicas' 1
(10 GB * 42 day) * (1 + 1 replica) * 1.45 = 1218GB # data node 1台あたり、最大512GBなので 3台必要 1218GB / 3 data node = 406GB
記事:
os_endpoint="https://search-EXAMPLE-dummy.ap-northeast-1.es.amazonaws.com" # index一覧 curl -s $os_endpoint/_cat/indices?v\&s=i health status index uuid pri rep docs.count docs.deleted store.size pri.store.size green open example-2023-03-25 dummyUUID 5 1 1010529 0 349.1mb 174.5mb g ...
# list index index=$(curl -s -X GET "${os_endpoint}/_cat/indices?v" | grep -o -P ' example-[^ ]+' | tr -d ' ') # delete old index for i in $index; do \ echo "# $i"; \ curl -s -X DELETE "${os_endpoint}/${i}"; \ echo; \ done
エラーログの有効化:
search.max_buckets Integer The maximum number of aggregation buckets allowed in a single response. Default is 65536.
os_endpoint=https://search-<domain>-****.ap-northeast-1.es.amazonaws.com curl -s "$os_endpoint/_cluster/settings?include_defaults=true&pretty" | jq -r '.defaults.search.max_buckets' 65535
制限事項:
記事:
HTTP/1.1 400 Bad Request ... Verify that the IAM role has access to the Elasticsearch cluster endpoint: https://search-<domain>...
記事:
記事:
slack等への通知:
記事:
記事:
os_endpoint=https://search-<domain>-****.ap-northeast-1.es.amazonaws.com index=example-2023-04-01 curl -s $os_endpoint/_plugins/_ism/explain/${index}?pretty
date -d @$((1676074602001/1000)) --iso-8601=sec 2023-02-11T09:16:42+09:00
環境:
現象:
一時的な対策:
os_endpoint=https://search-<domain>-****.ap-northeast-1.es.amazonaws.com index=example-2023-04- for i in $(seq -w 01 30); do \ curl -s -X POST "$os_endpoint/_plugins/_ism/remove/${index}$i?pretty" ; \ curl -s -X POST -H "Content-Type: application/json" -d '{ "policy_id": "cleanup-prod-access" }' "$os_endpoint/_plugins/_ism/add/${index}$i?pretty" ; \ done