Elastic Stack 8. 1일차.

박상준·2024년 7월 31일
0

엘라스틱스택8

목록 보기
1/3
post-custom-banner

ES 설치 및 동작 확인

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
  • es 보안관련 설정 전부 비활성화함.
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"
}
  • 9200 조회하여 실행 중인지 확인한다.
  • es 인스턴스 상태 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}
  • status -green 실행중임.

Kibana 설치 및 실행 등.

  • ES 에 별도로 security 를 설정하지 않았기에
/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibana

같은 토큰 등록과정은 불필요하다.

http://localhost:5601/app/home#/ 접속시

profile
이전 블로그 : https://oth3410.tistory.com/
post-custom-banner

0개의 댓글