Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to start elasticsearch docker container

I have installed docker on arch os and I have been using docker for a while now. Recently, docker run -v "$PWD/esdata":/usr/share/elasticsearch/data -d -p 9200:9200 -p 9300:9300 -e ES_JAVA_OPTS="-Xms1g -Xmx1g" elasticsearch:5.1 no longer works and the container automatically stops in a sec. I then tried the solution given here. By adding tail -f /dev/null to the end of my previous command. Now, the container runs but I get nothing when I go to localhost:9200

like image 568
Reuben_v1 Avatar asked Oct 19 '25 13:10

Reuben_v1


2 Answers

Came across the same issue with below command

docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:6.2.4

My environment is docker on MacOS. As per 'For those using Windows or OSX ' section in this article Docker memory needs to be 4GB min. After changing the memory limit, container started without any issues.

like image 98
Venura Avatar answered Oct 21 '25 02:10

Venura


in my case, it was a permission issue so I added permission next to the volume:

this one: //read, write and execute

version: '3'

services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:6.2.4
    environment:
      - discovery.type=single-node
    volumes:
      - /home/shared-content-initiative/elasticsearch:/usr/share/elasticsearch/data //read, write and execute
      - ./elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml


like image 42
Salahudin Malik Avatar answered Oct 21 '25 03:10

Salahudin Malik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!