version: '3.8'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.5.0
container_name: elasticsearch
environment:
- discovery.type=single-node
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- ELASTIC_PASSWORD=1234 # 초기 비밀번호 설정
- xpack.security.enrollment.enabled=false # 보안 기능 비활성화
- xpack.security.http.ssl.enabled=false # HTTP SSL 비활성화
- xpack.security.enabled=false # 보안 기능 비활성화
ulimits: { memlock: { soft: -1, hard: -1 } }
volumes:
- esdata:/usr/share/elasticsearch/data
ports:
- "9200:9200"
networks:
- elk
kibana:
image: docker.elastic.co/kibana/kibana:8.5.0
container_name: kibana
ports:
- "5601:5601"
environment:
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
networks:
- elk
logstash:
image: docker.elastic.co/logstash/logstash:8.5.0
container_name: logstash
# volumes:
# - ./logstash/config/logstash.yml:/usr/share/logstash/config/logstash.yml
# - ./logstash/pipeline:/usr/share/logstash/pipeline
ports:
- "5000:5000"
- "9600:9600"
environment:
# - LS_JAVA_OPTS="-Xmx256m -Xms256m"
- ELASTICSEARCH_USERNAME=elastic
- ELASTICSEARCH_PASSWORD=1234
networks:
- elk
networks:
elk:
driver: bridge
volumes:
esdata:
driver: local
elasticsearch@66deb3d4f55e:~$ curl -u elastic http://localhost:9200
Enter host password for user 'elastic':
{
"name" : "66deb3d4f55e",
"cluster_name" : "docker-cluster",
"cluster_uuid" : "t1i23i5zTvyGtZLKRIRQsg",
"version" : {
"number" : "8.5.0",
"build_flavor" : "default",
"build_type" : "docker",
"build_hash" : "c94b4700cda13820dad5aa74fae6db185ca5c304",
"build_date" : "2022-10-24T16:54:16.433628434Z",
"build_snapshot" : false,
"lucene_version" : "9.4.1",
"minimum_wire_compatibility_version" : "7.17.0",
"minimum_index_compatibility_version" : "7.0.0"
},
"tagline" : "You Know, for Search"
}
green
+ 할당되지 않은 샤드가 없는지 확인.elasticsearch@66deb3d4f55e:~$ curl -u elastic http://localhost:9200/_cluster/health
Enter host password for user 'elastic':
{"cluster_name":"docker-cluster","status":"green","timed_out":false,"number_of_nodes":1,"number_of_data_nodes":1,"active_primary_shards":1,"active_shards":1,"relocating_shards":0,"initializing_shards":0,"unassigned_shards":0,"delayed_unassigned_shards":0,"number_of_pending_tasks":0,"number_of_in_flight_fetch":0,"task_max_waiting_in_queue_millis":0,"active_shards_percent_as_number":100.0}
/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibana
같은 토큰 등록과정은 불필요하다.