dockerserverlocalhostwindows-subsystem-for-linuxopensearch-dashboards

Unable to get OpenSearch dashboard by running OpenSearch docker compose


I am a windows user. I installed Windows Subsystem for Linux [wsl2] and then installed docker using it. Then I tried to get started with OpenSearch so I followed the documentation in the given link https://opensearch.org/downloads.html and run docker-compose up, In the shell, I am getting an error message like

opensearch-dashboards | {"type":"log","@timestamp":"2022-01-18T16:31:18Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: getaddrinfo EAI_AGAIN opensearch-node1 opensearch-node1:9200"}

In the port http://localhost:5601/ I am getting messages like

OpenSearch Dashboards server is not ready yet

I also changed resources preference for memory to 5GB in docker-desktop but it still doesn't work. Can somebody help me with this?


Solution

  • After 5 days having issues with opensearch I've found something working fine for me:

    Then I use previous versions of opensearch because the latest does not seems stable:

    Here is my docker-compose.yml file:

    version: '3'
    services:
      opensearch-node1A:
        image: opensearchproject/opensearch:1.2.3
        container_name: opensearch-node1A
        environment:
          - cluster.name=opensearch-cluster
          - node.name=opensearch-node1A
          - discovery.seed_hosts=opensearch-node1A,opensearch-node2A
          - cluster.initial_master_nodes=opensearch-node1A,opensearch-node2A
          - bootstrap.memory_lock=true # along with the memlock settings below, disables swapping
          - "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" # minimum and maximum Java heap size, recommend setting both to 50% of system RAM
        ulimits:
          memlock:
            soft: -1
            hard: -1
          nofile:
            soft: 65536 # maximum number of open files for the OpenSearch user, set to at least 65536 on modern systems
            hard: 65536
        volumes:
          - opensearch-data1:/usr/share/opensearch/data
        ports:
          - 9200:9200
          - 9600:9600 # required for Performance Analyzer
        networks:
          - opensearch-net
      opensearch-node2A:
        image: opensearchproject/opensearch:1.2.3
        container_name: opensearch-node2A
        environment:
          - cluster.name=opensearch-cluster
          - node.name=opensearch-node2A
          - discovery.seed_hosts=opensearch-node1A,opensearch-node2A
          - cluster.initial_master_nodes=opensearch-node1A,opensearch-node2A
          - bootstrap.memory_lock=true
          - "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m"
        ulimits:
          memlock:
            soft: -1
            hard: -1
          nofile:
            soft: 65536
            hard: 65536
        volumes:
          - opensearch-data2:/usr/share/opensearch/data
        networks:
          - opensearch-net
      opensearch-dashboardsA:
        image: opensearchproject/opensearch-dashboards:1.1.0
        container_name: opensearch-dashboardsA
        ports:
          - 5601:5601
        expose:
          - "5601"
        environment:
          OPENSEARCH_HOSTS: '["https://opensearch-node1A:9200","https://opensearch-node2A:9200"]'
        networks:
          - opensearch-net
      logstash-with-plugin:
        image: opensearchproject/logstash-oss-with-opensearch-output-plugin:7.16.2
        container_name: logstash-with-plugin
        networks:
          - opensearch-net
    
    volumes:
      opensearch-data1:
      opensearch-data2:
    
    networks:
      opensearch-net: