728x90
설치 정보
- Verson 8.4.2
- Single Node Setting
- localhost 에 설치
네트워크 생성
docker network create elastic
도커 이미지 다운로드 & 도커 런
docker run --name es-node01 --net elastic -p 9200:9200 -p 9300:9300 -t docker.elastic.co/elasticsearch/elasticsearch:8.4.2
패스워드 재설정
docker exec -it es-node01 /usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic
패스워드 메모 : Gz-YD7e0hGc*5NsMRjvj
인증서파일 복사
docker cp es-node01:/usr/share/elasticsearch/config/certs/http_ca.crt .
연결 확인
curl --cacert http_ca.crt -u elastic:"<password>" https://localhost:9200
Python client 연결
from elasticsearch import Elasticsearch
# Password for the 'elastic' user generated by Elasticsearch
ELASTIC_PASSWORD = "<password>"
# Create the client instance
client = Elasticsearch(
"https://localhost:9200",
ca_certs="/path/to/http_ca.crt",
basic_auth=("elastic", ELASTIC_PASSWORD)
)
# Successful response!
client.info()
# {'name': 'instance-0000000000', 'cluster_name': ...}
Kibana Setup
docker run --name kib-01 --net elastic -p 5601:5601 docker.elastic.co/kibana/kibana:8.4.2
키바나 토큰 생성
docker exec -it es-node01 /usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibana
토큰 메모:
“eyJ2ZXIiOiI4LjQuMiIsImFkciI6WyIxNzIuMjIuMC4yOjkyMDAiXSwiZmdyIjoiMWViZmQ1NjczZjY2NTZmNWY3Mjc2ZjI0NGI4NjBiOGFlY2MwNDk3NGY0NjZhNDQ0OWZkY2RkYTJiNTc5MDY1ZCIsImtleSI6Ikd4ZVRLNFFCUzA2YlZGVUQ3cUQ5OlpmNjNUZGY4VFoyNExaaW1nV1NxeEEifQ==”
키바나 접속
http://0.0.0.0:5601/?code=888182
참고 :
https://www.elastic.co/guide/en/elasticsearch/reference/current/reset-password.html
https://www.elastic.co/guide/en/elasticsearch/client/python-api/current/connecting.html
반응형
'API > ElasticSearch' 카테고리의 다른 글
[ElasticSearch]. 엘라스틱서치 밋업(MeetUp) 참가 (0) | 2022.12.06 |
---|---|
[ElasticSearch]. 한국어 형태소 분석기 nori_analyzer 사용하기 (0) | 2022.12.05 |
[ElasticSearch]. 다중 검색 종류 비교 : 비동기 검색(async_search) VS 멀티 서치(msearch) (0) | 2022.08.23 |
[ElasticSearch]. 크론탭(crontab)으로 리눅스 서버 꺼지면 자동 재실행 하기 (0) | 2022.08.14 |
[ElasticSearch] SSL/TLS security https setting 외부에서 접속하기( version 8.x) (0) | 2022.04.06 |