Free Lines Arrow
본문 바로가기
SearchEngine/OpenSearch

[OpenSearch] OpenSearch 설치

by p8labs 2025. 6. 15.
728x90
반응형
반응형

OpenSearch

회사에서 오픈서치를 적용하게되어 공부겸 높은 이해도를 높이기 위해 글을 작성해 봅니다.

 

OpenSearch 설치

opensearch.yaml 작성

  • 도커로 실행하기 위해서 yaml 파일을 작성해 줍니다.
  • 연습 용이기 때문에 node 는 하나만 지정해 줍니다.
  • opensearch-node1: 노드1 서버를 설치하기 위한 설정
  • opensearch-dashboards: GUI 를 위한 대시 보드
  • OPENSEARCH_INITIAL_ADMIN_PASSWORD=Root123#@! : 어드민 password 지정
services:
  opensearch-node1: # This is also the hostname of the container within the Docker network (i.e. https://opensearch-node1/)
    image: opensearchproject/opensearch:latest # Specifying the latest available image - modify if you want a specific version
    container_name: opensearch-node1
    environment:
      - cluster.name=opensearch-cluster # Name the cluster
      - node.name=opensearch-node1 # Name the node that will run in this container
      - cluster.initial_cluster_manager_nodes=opensearch-node1 # Nodes eligible to serve as cluster manager
      - bootstrap.memory_lock=true # Disable JVM heap memory swapping
      - "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" # Set min and max JVM heap sizes to at least 50% of system RAM
      - OPENSEARCH_INITIAL_ADMIN_PASSWORD=Root123#@!    # Sets the demo admin user password when using demo configuration, required for OpenSearch 2.12 and later
    ulimits:
      memlock:
        soft: -1 # Set memlock to unlimited (no soft or hard limit)
        hard: -1
      nofile:
        soft: 65536 # Maximum number of open files for the opensearch user - set to at least 65536
        hard: 65536
    volumes:
      - opensearch-data1:/usr/share/opensearch/data # Creates volume called opensearch-data1 and mounts it to the container
    ports:
      - 9200:9200 # REST API
      - 9600:9600 # Performance Analyzer
    networks:
      - opensearch-net # All of the containers will join the same Docker bridge network
  opensearch-dashboards:
    image: opensearchproject/opensearch-dashboards:latest # Make sure the version of opensearch-dashboards matches the version of opensearch installed on other nodes
    container_name: opensearch-dashboards
    ports:
      - 5601:5601 # Map host port 5601 to container port 5601
    expose:
      - "5601" # Expose port 5601 for web access to OpenSearch Dashboards
    environment:
      OPENSEARCH_HOSTS: '["https://opensearch-node1:9200"]' # Define the OpenSearch nodes that OpenSearch Dashboards will query
    networks:
      - opensearch-net

volumes:
  opensearch-data1:

networks:
  opensearch-net:

 

 

Opensearch Dashbord 접근

http://localhost:5601/app/login

 

 

Login

 

 

정상적으로 오픈서치를 설치하고 접근하였습니다.

실무에서는 노드당 최대 샤드가 지정되어 있기 때문에 필요에 따라서 노드수를 늘리거나 샤드수를 늘려야 합니다.

 

 

 

참고:

https://docs.opensearch.org/docs/latest/install-and-configure/install-opensearch/docker/

728x90
반응형

'SearchEngine > OpenSearch' 카테고리의 다른 글

[OpenSearch] Suggest API  (0) 2025.06.22

댓글