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?
4
Answers
I had the same error message when opening "http://localhost:5601/" while testing opensearch and opensearch dasboard locally using Docker in Windows 10:
{"type":"log","@timestamp":"2022-02-10T12:29:35Z","tags":["error","opensearch","data"],"pid":1,"message":"[ConnectionError]:
getaddrinfo EAI_AGAIN opensearch-node1 opensearch-node1:9200"}
But when looking into the log I also found this other error:
The 3 part solution working for me was:
Part 1
On each opensearch nodes update the file:
And add line:
Before the security plugins:
I found the information on opensearch official documentation
Part 2
Setting allocated memory for docker desktop to 4GB into .wslconfig more information here:
opendistrocommunity discussion
stackoverflow aloocate memory
Make sure your allocated memory is well set up (you have to restart docker desktop) with this command: docker info and check the line "Total Memory" it should be set to 4GB (approximately, in my case it has be set to 3.84GiB)
Part 3
And also increase vm.max_map_count:
The info was founded here on github discussion
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:
I had the same issue with my Opensearch-dashboards instance installed on VM without Docker usage. The problem was caused by wrong setting for connection to search engine in the
opensearch-dashboards.yml
file. I mixed up https and http protocols here (there was mismatch between settings of opensearch and opensearch-dashboards):opensearch.hosts: [https://localhost:9200]
Incase if this helps some1,
I had no luck following official doc (especially with multi-nodes) and ended up setting it up manually with my limited Docker knowledge.
Below is my setup
opensearch:1.3.8 (single node) server setup
run opensearch single node :
docker run -d -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" opensearchproject/opensearch:1.3.8
ensure its up & running
docker ps
ensure you are able to hit api with login creds,
defaults are
https://localhost:9200
uname:admin
pass:admin
inspect container to get Gateway :
docker inspect <containerName> or <containerId>
to grabNetworkSettings
.Gateway
property, note it down somewhere, will be required to setup opensearch-dashboard. For me it was something like172.17.117.1
opensearch-dashboard:1.3.8 setup
custom-opensearch-dashboards.yml
file somewhere in your WLS2 home directory with below contentspull opensearch-dashboards image :
docker pull opensearchproject/opensearch-dashboards:1.3.8
run opensearch-dashboards with customized config:
docker run -d -p 5601:5601 -v /fullPath/of/custom-opensearch-dashboards.yml:/usr/share/opensearch-dashboards/config/opensearch_dashboards.yml
ensure its up & running
docker ps
on your browser see if you can load
http://localhost:5601/
and log in withopensearch.username
opensearch.password
credsOther useful Docker commands
view logs
docker logs <containerName> or <containerId>
sh to container to check config or ping required apis :
docker exec -it <containerName> or <containerId> sh
Good luck !