elasticsearch

19 commands

19 shown

Здоровье кластера Статус кластера: green/yellow/red, шарды, ноды curl -s http://localhost:9200/_cluster/health | jq . #elasticsearch#monitoring Список индексов Табличный список индексов отсортированный по размеру curl -s 'http://localhost:9200/_cat/indices?v&h=index,health,pri,rep,docs.count,store.size&s=store.size:desc' #elasticsearch Удалить индекс Удалить индекс и все его данные curl -X DELETE http://localhost:9200/<index> #elasticsearch Настройки индекса Количество шардов, реплик, интервал обновления curl -s http://localhost:9200/<index>/_settings | jq . #elasticsearch Переиндексировать Скопировать документы из одного индекса в другой curl -X POST http://localhost:9200/_reindex -H 'Content-Type: application/json' -d '{"source":{"index":"old"},"dest":{"index":"new"}}' #elasticsearch Force merge индекса Уменьшить количество сегментов; полезно перед переводом в read-only curl -X POST 'http://localhost:9200/<index>/_forcemerge?max_num_segments=1' #elasticsearch Статистика нод Все ноды ES с JVM heap, нагрузкой, ролями curl -s http://localhost:9200/_cat/nodes?v #elasticsearch#monitoring Поисковый запрос Полнотекстовый поиск документов по слову curl -s -X POST http://localhost:9200/<index>/_search -H 'Content-Type: application/json' -d '{"query":{"match":{"message":"error"}}}' #elasticsearch Создать snapshot Создать snapshot в зарегистрированном репозитории curl -X PUT http://localhost:9200/_snapshot/<repo>/<snapshot> #elasticsearch ILM состояние индекса Текущая ILM фаза и действие для индекса curl -s 'http://localhost:9200/<index>/_ilm/explain' | jq '.indices | to_entries[] | {index:.key, phase:.value.phase, action:.value.action}' #elasticsearch Здоровье кластера Статус кластера: green/yellow/red с количеством шардов curl -s http://es:9200/_cluster/health?pretty #elasticsearch#monitoring Список индексов с размером Все индексы по убыванию размера curl -s 'http://es:9200/_cat/indices?v&s=store.size:desc' #elasticsearch#monitoring Удалить старый индекс Удалить конкретный индекс (необратимо) curl -X DELETE http://es:9200/logs-2024.01.01 #elasticsearch Поиск с Query DSL Найти последние 5 записей уровня error curl -X GET 'http://es:9200/logs-*/_search?pretty' -H 'Content-Type: application/json' -d '{"query":{"match":{"level":"error"}},"size":5}' #elasticsearch#debug Распределение шардов Все шарды с состоянием и причиной назначения curl -s 'http://es:9200/_cat/shards?v&h=index,shard,prirep,state,node,unassigned.reason' #elasticsearch#debug Принудительное переназначение шарда Повторить назначение всех неудавшихся шардов curl -X POST http://es:9200/_cluster/reroute?retry_failed=true #elasticsearch#debug Обновить настройки индекса Изменить количество реплик у живого индекса curl -X PUT 'http://es:9200/my-index/_settings' -H 'Content-Type: application/json' -d '{"index":{"number_of_replicas":1}}' #elasticsearch Создать шаблон индекса Авто-конфигурация новых индексов по маске logs-* curl -X PUT 'http://es:9200/_index_template/logs-tpl' -H 'Content-Type: application/json' -d '{"index_patterns":["logs-*"],"template":{"settings":{"number_of_shards":2}}}' #elasticsearch Снимок в репозиторий Создать снимок кластера синхронно curl -X PUT 'http://es:9200/_snapshot/my_repo/snap1?wait_for_completion=true' #elasticsearch
no commands match