Elasticsearch 자주 쓰이는 명령어모음

By | 2020년 7월 7일
Table of Contents

Elasticsearch 자주 쓰이는 명령어모음

상태확인

실행상태 확인

curl -X GET 'localhost:9200'

curl -X GET 'localhost:9200/_cat/health'

로그 확인

sudo tail -200 /var/log/elasticsearch/elasticsearch.log

실행/중지/재시작

sudo systemctl start elasticsearch

sudo systemctl stop elasticsearch

sudo systemctl restart elasticsearch

설정 변경

elasticsearch.yml

sudo vi /etc/elasticsearch/elasticsearch.yml

샤드 재할당 중지 및 활성화

curl -XPUT 'localhost:9200/_cluster/settings?pretty' -H 'Content-Type: application/json' -d '{
    "transient" : {
        "cluster.routing.allocation.enable" : "none"
    }
}'

curl -XPUT 'localhost:9200/_cluster/settings?pretty' -H 'Content-Type: application/json' -d '{
    "transient" : {
        "cluster.routing.allocation.enable" : "all"
    }
}'

플러그인

플러그인 확인 설치 삭제

sudo /usr/share/elasticsearch/bin/elasticsearch-plugin install file://`pwd`/elasticsearch-analysis-seunjeon-6.1.1.1.zip

sudo /usr/share/elasticsearch/bin/elasticsearch-plugin list
analysis-seunjeon

sudo /usr/share/elasticsearch/bin/elasticsearch-plugin remove analysis-seunjeon

답글 남기기