Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
db:elasticsearch [2025/09/29 09:46]
tomas created
db:elasticsearch [2026/01/20 09:12] (current)
tomas [REST API]
Line 1: Line 1:
-curl -s -u UZIVATEL:HESLO "https://HOSTNAME/_cluster/settings?include_defaults=true&flat_settings=true ... vypíše konfiguraci\\ +ElasticSearch je produkt pro analytiku a prohledáváníSoučástí je Kibana pro vizualizaciData jsou ukládána v indexech ve formě JSONPro ovládání a hledání nabízí REST API.
-curl -s -u UZIVATEL:HESLO "https://HOSTNAME/_alias ... vylistuje indexy a jejich aliasy\\+
  
 +==== REST API ====
 +
 +=== Inicializace příkazové řádky ===
 +''export ELSRV="elasticsearch_https_adresa"'' ... Nastaví adresu ve tvaru https://domenove.jmeno\\
 +''export ELUSR="elasticsearch_uzivalel"'' ... nastaví ElasticSeach uživatele\\
 +''read -s ELPWD''\\
 +''export ELPWD'' ... nastaví ElasticSearch heslo\\
 +
 +=== Konfigurace, stav ===
 +''%%curl -s -u $ELUSR:$ELPWD https://$ELSRV/_cluster/settings?include_defaults=true&flat_settings=true%%'' ... vypíše konfiguraci\\
 +''%%curl -s -u $ELUSR:$ELPWD https://$ELSRV/INDEX/_cluster/state%%'' ... Ukáže stav a informaci o clusteru\\
 +''%%curl -s -u $ELUSR:$ELPWD https://$ELSRV/INDEX/_cluster/allocation/explain | jq .%%'' ... ukáže informace o alokaci\\
 +''%%curl -s -u $ELUSR:$ELPWD https://$ELSRV/INDEX/_cluster/health%%'' ... ukáže informace o zdraví clusteru\\
 +
 +
 +=== Indexy ===
 +''%%curl -s -u $ELUSR:$ELPWD https://$ELSRV/_alias%%'' ... vylistuje indexy a jejich aliasy\\
 +''%%curl -s -u $ELUSR:$ELPWD https://$ELSRV/INDEX/_settings%%'' ... ukáže nastavení indexu INDEX\\
 +''%%curl -s -u $ELUSR:$ELPWD https://$ELSRV/_cat/indices?v%%'' ... seznam indexů, jejich stav a velikost\\
 +''%%curl -s -u $ELUSR:$ELPWD -X PUT -H 'Content-Type: application/json' -d '{ "index": { "blocks.read_only" : true } }' https://$ELSRV/INDEX/_settings"%%'' ... nastaví index na read-only\\
 +''%%curl -s -u $ELUSR:$ELPWD -X POST https://$ELSRV/INDEX/_clone/KOPIE%%'' ... naklonuje index INDEX do KOPIE\\
 +
 +=== Snapshoty ===
 +''%%curl -s -u $ELUSR:$ELPWD https://$ELSRV/INDEX/_slm/policy | jq .%%'' ... ukáže snapshot policy\\
 +''%%curl -s -u $ELUSR:$ELPWD -X POST https://$ELSRV/INDEX/_slm/policy/POLICY/_execute | jq .%%'' ... provede snapshot pro policy POLICY\\
  
-''curl -s -u UZIVATEL:HESLO -X PUT -H 'Content-Type: application/json' -d '{ "index": { "blocks.read_only" : true } }' "https://HOSTNAME/INDEX/_settings"'' ... nastaví index na read-only\\