Trouble installing OpenSearch with docker-compose - [ConnectionError]: getaddrinfo ENOTFOUND opensearch-node1

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
2.12.0

Describe the issue:
Following the instructions for Docker Compose here I get the same error on two different computers. I’ve tried on a Linux machine running docker, and MacOSX Running Orbstack.

After running docker-compose up, after a while this error keeps appearing, over and over again.

opensearch-dashboards    | {"type":"log","@timestamp":"2024-03-06T14:53:56Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: getaddrinfo ENOTFOUND opensearch-node1"}

Attemps to view the dashboard in the browser just says this:

OpenSearch Dashboards server is not ready yet.

Configuration:

nic@pop-os:~$ cat /proc/sys/vm/max_map_count
2147483642

Relevant Logs or Screenshots:
The full output is below.

WARNING: The OPENSEARCH_INITIAL_ADMIN_PASSWORD variable is not set. Defaulting to a blank string.
Creating network "opensearch_opensearch-net" with the default driver
Creating volume "opensearch_opensearch-data1" with default driver
Creating volume "opensearch_opensearch-data2" with default driver
Pulling opensearch-node1 (opensearchproject/opensearch:latest)...
latest: Pulling from opensearchproject/opensearch
8784573bb84d: Pull complete
89767333778b: Pull complete
8c6d0629aa21: Pull complete
ef3f4ed5e7ea: Pull complete
4f4fb700ef54: Pull complete
8a102654bfed: Pull complete
12f8baeda507: Pull complete
Digest: sha256:d071a4ed56aa23dbdc65530a29bf2797ea0baf9c42a86bfa188a2c168c02aed1
Status: Downloaded newer image for opensearchproject/opensearch:latest
Pulling opensearch-dashboards (opensearchproject/opensearch-dashboards:latest)...
latest: Pulling from opensearchproject/opensearch-dashboards
8784573bb84d: Already exists
451fe8bbcb3a: Pull complete
fd219960c81d: Pull complete
799d81349773: Pull complete
45e90d2d5e54: Pull complete
4f4fb700ef54: Pull complete
Digest: sha256:d9a156c5f3f78b4686f38fa5e82abe576504afb4531ba4e00abc16f78a2c232f
Status: Downloaded newer image for opensearchproject/opensearch-dashboards:latest
Creating opensearch-node1      ... done
Creating opensearch-node2      ... done
Creating opensearch-dashboards ... done
Attaching to opensearch-dashboards, opensearch-node1, opensearch-node2
opensearch-node1         | Enabling OpenSearch Security Plugin
opensearch-node1         | Enabling execution of install_demo_configuration.sh for OpenSearch Security Plugin 
opensearch-node1         | OpenSearch 2.12.0 onwards, the OpenSearch Security Plugin a change that requires an initial password for 'admin' user. 
opensearch-node1         | Please define an environment variable 'OPENSEARCH_INITIAL_ADMIN_PASSWORD' with a strong password string. 
opensearch-node1         | If a password is not provided, the setup will quit. 
opensearch-node1         |  For more details, please visit: https://opensearch.org/docs/latest/install-and-configure/install-opensearch/docker/
opensearch-node2         | Enabling OpenSearch Security Plugin
opensearch-node2         | Enabling execution of install_demo_configuration.sh for OpenSearch Security Plugin 
opensearch-node2         | OpenSearch 2.12.0 onwards, the OpenSearch Security Plugin a change that requires an initial password for 'admin' user. 
opensearch-node2         | Please define an environment variable 'OPENSEARCH_INITIAL_ADMIN_PASSWORD' with a strong password string. 
opensearch-node2         | If a password is not provided, the setup will quit. 
opensearch-node2         |  For more details, please visit: https://opensearch.org/docs/latest/install-and-configure/install-opensearch/docker/
opensearch-node1         | ### OpenSearch Security Demo Installer
opensearch-node1         | ### ** Warning: Do not use on production or public reachable systems **
opensearch-node1         | OpenSearch install type: rpm/deb on Linux 6.6.10-76060610-generic amd64
opensearch-node1         | OpenSearch config dir: /usr/share/opensearch/config/
opensearch-node1         | OpenSearch config file: /usr/share/opensearch/config/opensearch.yml
opensearch-node1         | OpenSearch bin dir: /usr/share/opensearch/bin/
opensearch-node1         | OpenSearch plugins dir: /usr/share/opensearch/plugins/
opensearch-node1         | OpenSearch lib dir: /usr/share/opensearch/lib/
opensearch-node1         | Detected OpenSearch Version: 2.12.0
opensearch-node1         | Detected OpenSearch Security Version: 2.12.0.0
opensearch-node2         | ### OpenSearch Security Demo Installer
opensearch-node2         | ### ** Warning: Do not use on production or public reachable systems **
opensearch-node2         | OpenSearch install type: rpm/deb on Linux 6.6.10-76060610-generic amd64
opensearch-node2         | OpenSearch config dir: /usr/share/opensearch/config/
opensearch-node2         | OpenSearch config file: /usr/share/opensearch/config/opensearch.yml
opensearch-node2         | OpenSearch bin dir: /usr/share/opensearch/bin/
opensearch-node2         | OpenSearch plugins dir: /usr/share/opensearch/plugins/
opensearch-node2         | OpenSearch lib dir: /usr/share/opensearch/lib/
opensearch-node2         | Detected OpenSearch Version: 2.12.0
opensearch-node2         | Detected OpenSearch Security Version: 2.12.0.0
opensearch-node2         | No custom admin password found. Please provide a password via the environment variable OPENSEARCH_INITIAL_ADMIN_PASSWORD.
opensearch-node1         | No custom admin password found. Please provide a password via the environment variable OPENSEARCH_INITIAL_ADMIN_PASSWORD.
opensearch-node2 exited with code 1
opensearch-node1 exited with code 1
opensearch-dashboards    | {"type":"log","@timestamp":"2024-03-06T14:53:18Z","tags":["info","plugins-service"],"pid":1,"message":"Plugin \"dataSourceManagement\" has been disabled since the following direct or transitive dependencies are missing or disabled: [dataSource]"}
opensearch-dashboards    | {"type":"log","@timestamp":"2024-03-06T14:53:18Z","tags":["info","plugins-service"],"pid":1,"message":"Plugin \"dataSource\" is disabled."}
opensearch-dashboards    | {"type":"log","@timestamp":"2024-03-06T14:53:18Z","tags":["info","plugins-service"],"pid":1,"message":"Plugin \"visTypeXy\" is disabled."}
opensearch-dashboards    | {"type":"log","@timestamp":"2024-03-06T14:53:18Z","tags":["warning","config","deprecation"],"pid":1,"message":"\"cpu.cgroup.path.override\" is deprecated and has been replaced by \"ops.cGroupOverrides.cpuPath\""}
opensearch-dashboards    | {"type":"log","@timestamp":"2024-03-06T14:53:18Z","tags":["warning","config","deprecation"],"pid":1,"message":"\"cpuacct.cgroup.path.override\" is deprecated and has been replaced by \"ops.cGroupOverrides.cpuAcctPath\""}
opensearch-dashboards    | {"type":"log","@timestamp":"2024-03-06T14:53:18Z","tags":["warning","config","deprecation"],"pid":1,"message":"\"opensearch.requestHeadersWhitelist\" is deprecated and has been replaced by \"opensearch.requestHeadersAllowlist\""}
opensearch-dashboards    | [agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
opensearch-dashboards    | [agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
opensearch-dashboards    | {"type":"log","@timestamp":"2024-03-06T14:53:18Z","tags":["info","plugins-system"],"pid":1,"message":"Setting up [52] plugins: [usageCollection,opensearchDashboardsUsageCollection,opensearchDashboardsLegacy,mapsLegacy,share,opensearchUiShared,legacyExport,embeddable,expressions,data,securityAnalyticsDashboards,home,apmOss,savedObjects,searchRelevanceDashboards,reportsDashboards,dashboard,mlCommonsDashboards,visualizations,visTypeVega,visTypeTimeline,visTypeTable,visTypeMarkdown,visBuilder,visAugmenter,anomalyDetectionDashboards,alertingDashboards,tileMap,regionMap,customImportMapDashboards,inputControlVis,ganttChartDashboards,visualize,queryWorkbenchDashboards,indexManagementDashboards,notificationsDashboards,management,indexPatternManagement,advancedSettings,console,dataExplorer,charts,visTypeVislib,visTypeTimeseries,visTypeTagcloud,visTypeMetric,discover,savedObjectsManagement,securityDashboards,assistantDashboards,observabilityDashboards,bfetch]"}
opensearch-dashboards    | [agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
opensearch-dashboards    | [agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
opensearch-dashboards    | [agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
opensearch-dashboards    | [agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
opensearch-dashboards    | [agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
opensearch-dashboards    | [agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
opensearch-dashboards    | [agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
opensearch-dashboards    | [agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
opensearch-dashboards    | [agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
opensearch-dashboards    | [agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
opensearch-dashboards    | [agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
opensearch-dashboards    | [agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
opensearch-dashboards    | [agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
opensearch-dashboards    | [agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
opensearch-dashboards    | [agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
opensearch-dashboards    | [agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
opensearch-dashboards    | [agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
opensearch-dashboards    | [agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
opensearch-dashboards    | [agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
opensearch-dashboards    | [agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
opensearch-dashboards    | [agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
opensearch-dashboards    | [agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
opensearch-dashboards    | [agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
opensearch-dashboards    | [agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
opensearch-dashboards    | [agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
opensearch-dashboards    | [agentkeepalive:deprecated] options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead
opensearch-dashboards    | {"type":"log","@timestamp":"2024-03-06T14:53:18Z","tags":["info","savedobjects-service"],"pid":1,"message":"Waiting until all OpenSearch nodes are compatible with OpenSearch Dashboards before starting saved objects migrations..."}
opensearch-dashboards    | {"type":"log","@timestamp":"2024-03-06T14:53:18Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: getaddrinfo ENOTFOUND opensearch-node1"}
opensearch-dashboards    | {"type":"log","@timestamp":"2024-03-06T14:53:18Z","tags":["error","savedobjects-service"],"pid":1,"message":"Unable to retrieve version information from OpenSearch nodes."}
opensearch-dashboards    | {"type":"log","@timestamp":"2024-03-06T14:53:21Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: getaddrinfo ENOTFOUND opensearch-node1"}
opensearch-dashboards    | {"type":"log","@timestamp":"2024-03-06T14:53:23Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: getaddrinfo ENOTFOUND opensearch-node1"}
opensearch-dashboards    | {"type":"log","@timestamp":"2024-03-06T14:53:26Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: getaddrinfo ENOTFOUND opensearch-node1"}
opensearch-dashboards    | {"type":"log","@timestamp":"2024-03-06T14:53:28Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: getaddrinfo ENOTFOUND opensearch-node1"}
opensearch-dashboards    | {"type":"log","@timestamp":"2024-03-06T14:53:31Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: getaddrinfo ENOTFOUND opensearch-node1"}
opensearch-dashboards    | {"type":"log","@timestamp":"2024-03-06T14:53:33Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: getaddrinfo ENOTFOUND opensearch-node1"}
opensearch-dashboards    | {"type":"log","@timestamp":"2024-03-06T14:53:36Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: getaddrinfo ENOTFOUND opensearch-node1"}
opensearch-dashboards    | {"type":"log","@timestamp":"2024-03-06T14:53:38Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: getaddrinfo ENOTFOUND opensearch-node1"}
opensearch-dashboards    | {"type":"log","@timestamp":"2024-03-06T14:53:41Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: getaddrinfo ENOTFOUND opensearch-node1"}
opensearch-dashboards    | {"type":"log","@timestamp":"2024-03-06T14:53:43Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: getaddrinfo ENOTFOUND opensearch-node1"}
opensearch-dashboards    | {"type":"log","@timestamp":"2024-03-06T14:53:46Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: getaddrinfo ENOTFOUND opensearch-node1"}
opensearch-dashboards    | {"type":"log","@timestamp":"2024-03-06T14:53:48Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: getaddrinfo ENOTFOUND opensearch-node1"}
opensearch-dashboards    | {"type":"log","@timestamp":"2024-03-06T14:53:51Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: getaddrinfo ENOTFOUND opensearch-node1"}
opensearch-dashboards    | {"type":"log","@timestamp":"2024-03-06T14:53:53Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: getaddrinfo ENOTFOUND opensearch-node1"}
opensearch-dashboards    | {"type":"log","@timestamp":"2024-03-06T14:53:56Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]: getaddrinfo ENOTFOUND opensearch-node1"}

Hi, @searchMrNr!
Please follow the instructions noticed here:

If you are trying to setup Demo configuration see also:

Hi rsen, I have followed the instructions there, specifically disabling swap and setting
max_map_count

Is there anything else there that I need to do that I’m missing?

@searchMrNr
Did you set OPENSEARCH_INITIAL_ADMIN_PASSWORD variable? It is nessesary to do this

Hi @searchMrNr,

Would you mind sharing your docker-compose file, so I can take a look at it and try fixing it?

best,
mj

Hi - I’m just using the docker-compose file from the instructions:

https://opensearch.org/samples/docker-compose.yml

thanks!

Hi @searchMrNr,

Looks like your admin password was not accepted:

    environment:
      - OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_INITIAL_ADMIN_PASSWORD}

Set it up in your .env file or directly in your docker-compose.yml file.
note: this has to be a complex password or it will be rejected.

Best,
mj