Elasticsearch 세팅 - Docker

  1. compose.yml

    services:
      elastic:
        image: docker.elastic.co/elasticsearch/elasticsearch:8.17.4 # Elastic 8.17.4 버전의 이미지
        ports:
        - 9200:9200 # 9200번 포트에서 Elasticsearch 실행
        environment:
        # 아래 설정은 개발/테스트 환경에서 간단하게 테스트하기 위한 옵션 (운영 환경에서는 설정하면 안 됨)
        - discovery.type=single-node # 단일 노드 (지금은 알 필요 없음)
        - xpack.security.enabled=false # 보안 설정
        - xpack.security.http.ssl.enabled=false # 보안 설정
    
  2. compose 실행

    # 실행
    docker compose up -d
    
    # 확인
    docker ps
    
    # 중지
    docker compose down
    
  3. 잘 실행됐는 지 확인하기

    Elasticsearch는 9200번 포트에서 실행된다.

    GET l[ocalhost:9200](<http://localhost:9200>)
    

    image.png