OpenSearch Dashboards server is not ready yet in docker

Versions :
OpenSearch - 2.15.0
Docker - 26.1.3
Docker Compose - 2.27.0

Describe the issue:
I installed an open source cluster in docker. Before starting docker-compos and then
I open the browser and it shows me the error OpenSearch Dashboards server is not ready yet

check docker logs

{"type":"log","@timestamp":"2024-07-13T10:50:16Z","tags":["info","plugins-service"],"pid":1,"message":"Plugin \"dataSourceManagement\" has been disabled since the following direct or transitive dependencies are missing or disabled: [dataSource]"}
{"type":"log","@timestamp":"2024-07-13T10:50:16Z","tags":["info","plugins-service"],"pid":1,"message":"Plugin \"applicationConfig\" is disabled."}
{"type":"log","@timestamp":"2024-07-13T10:50:16Z","tags":["info","plugins-service"],"pid":1,"message":"Plugin \"dataSource\" is disabled."}
{"type":"log","@timestamp":"2024-07-13T10:50:16Z","tags":["info","plugins-service"],"pid":1,"message":"Plugin \"cspHandler\" is disabled."}
{"type":"log","@timestamp":"2024-07-13T10:50:16Z","tags":["info","plugins-service"],"pid":1,"message":"Plugin \"visTypeXy\" is disabled."}
{"type":"log","@timestamp":"2024-07-13T10:50:16Z","tags":["info","plugins-service"],"pid":1,"message":"Plugin \"workspace\" is disabled."}
{"type":"log","@timestamp":"2024-07-13T10:50:16Z","tags":["warning","config","deprecation"],"pid":1,"message":"\"cpu.cgroup.path.override\" is deprecated and has been replaced by \"ops.cGroupOverrides.cpuPath\""}
{"type":"log","@timestamp":"2024-07-13T10:50:16Z","tags":["warning","config","deprecation"],"pid":1,"message":"\"cpuacct.cgroup.path.override\" is deprecated and has been replaced by \"ops.cGroupOverrides.cpuAcctPath\""}
{"type":"log","@timestamp":"2024-07-13T10:50:16Z","tags":["warning","config","deprecation"],"pid":1,"message":"\"opensearch.requestHeadersWhitelist\" is deprecated and has been replaced by \"opensearch.requestHeadersAllowlist\""}
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
{"type":"log","@timestamp":"2024-07-13T10:50:16Z","tags":["info","plugins-system"],"pid":1,"message":"Setting up [52] plugins: [usageCollection,opensearchDashboardsUsageCollection,opensearchDashboardsLegacy,mapsLegacy,opensearchUiShared,share,legacyExport,embeddable,expressions,data,securityAnalyticsDashboards,savedObjects,home,apmOss,searchRelevanceDashboards,reportsDashboards,dashboard,mlCommonsDashboards,assistantDashboards,visualizations,visTypeTimeline,visTypeVega,visTypeTable,visBuilder,visTypeMarkdown,visAugmenter,anomalyDetectionDashboards,alertingDashboards,regionMap,customImportMapDashboards,tileMap,inputControlVis,ganttChartDashboards,visualize,indexManagementDashboards,notificationsDashboards,management,indexPatternManagement,advancedSettings,console,dataExplorer,charts,visTypeTimeseries,visTypeVislib,visTypeTagcloud,visTypeMetric,discover,savedObjectsManagement,securityDashboards,observabilityDashboards,queryWorkbenchDashboards,bfetch]"}
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
[agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
{"type":"log","@timestamp":"2024-07-13T10:50:16Z","tags":["info","savedobjects-service"],"pid":1,"message":"Waiting until all OpenSearch nodes are compatible with OpenSearch Dashboards before starting saved objects migrations..."}
{"type":"log","@timestamp":"2024-07-13T10:50:16Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:50:17Z","tags":["error","savedobjects-service"],"pid":1,"message":"Unable to retrieve version information from OpenSearch nodes."}
{"type":"log","@timestamp":"2024-07-13T10:50:19Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:50:21Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:50:24Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:50:26Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:50:29Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:50:31Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:50:34Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:50:36Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:50:39Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:50:41Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:50:44Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:50:46Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:50:49Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:50:51Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:50:54Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:50:56Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:50:59Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:51:01Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:51:04Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:51:06Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:51:09Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:51:11Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:51:14Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:51:16Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:51:19Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:51:21Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:51:24Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:51:26Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:51:29Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:51:31Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:51:34Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:51:36Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:51:39Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:51:41Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:51:44Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:51:46Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:51:49Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:51:51Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}
{"type":"log","@timestamp":"2024-07-13T10:51:54Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: socket hang up"}

my docker-compose.yml

version: '3'
services:
  opensearch-node1: # This is also the hostname of the container within the Docker network (i.e. https://opensearch-node1/)
    image: opensearch:2.15.0 # 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=node-01 # Name the node that will run in this container
      - discovery.seed_hosts=node-01,node-02,node-03 # Nodes to look for when discovering the cluster
      - cluster.initial_cluster_manager_nodes=node-01,node-02,node-03 # Nodes eligible to serve as cluster manager
      - bootstrap.memory_lock=true # Disable JVM heap memory swapping
      - "OPENSEARCH_JAVA_OPTS=-Xms8192m -Xmx8192m" # Set min and max JVM heap sizes to at least 50% of system RAM
      - OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_INITIAL_ADMIN_PASSWORD}    # 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:
      - /data/opensearch:/usr/share/opensearch/data # Creates volume called opensearch-data1 and mounts it to the container
    ports:
      - 9200:9200 # REST API
      - 9600:9600 # Performance Analyzer
    network_mode: host


#    networks:
#      - opensearch-net # All of the containers will join the same Docker bridge network

  opensearch-dashboards:
    image: opensearch-dashboards:2.15.0 # 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: '["http://node-01:9200","http://node-02:9200","http://node-03:9200"]' # Define the OpenSearch nodes that OpenSearch Dashboards will query
    network_mode: host

version: β€˜3’
services:
fluent-bit:
container_name: fluent-bit
image: fluent/fluent-bit
volumes:
- ./fluent-bit.conf:/fluent-bit/etc/fluent-bit.conf
- ./test.log:/var/log/test.log
networks:
- dscnet
opensearch:
container_name: opensearch
image: opensearchproject/opensearch:latest
environment:
- discovery.type=single-node
- bootstrap.memory_lock=true # along with the memlock settings below, disables swapping
- β€œOPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m” # minimum and maximum Java heap size, recommend set
- OPENSEARCH_INITIAL_ADMIN_PASSWORD=Developer@123
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536 # maximum number of open files for the OpenSearch user, set to at least 65536 on
hard: 65536
ports:
- 9200:9200
- 9600:9600 # required for Performance Analyzer
networks:
- dscnet
dashboards:
image: opensearchproject/opensearch-dashboards:latest
container_name: opensearch-dashboards
ports:
- 5601:5601
expose:
- β€œ5601”
environment:
OPENSEARCH_HOSTS: β€˜[β€œhttps://localhost:9200”]’
depends_on:
- opensearch
networks:
- dscnet

networks:
dscnet:
external: true
driver: overlay
name: test-net

try this

@jayesh

your dockerfile uses a single node, and I use a cluster, I have 3 nodes in a docker container, my nodes are on three physical hosts and I want to use the network from my physical host

I found what was wrong

The problem was in the opensearch.hosts: line, I needed to add https and added depends_on:

my docker-compose.yml

opensearch-dashboards:
    image: opensearch-dashboards:2.15.0 # 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://node-01:9200","https://node-02:9200","https://node-03:9200"]' # Define the OpenSearch nodes that OpenSearch Dashboards will query
    depends_on: 
      - opensearch-node1
    network_mode: host
1 Like