Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with writing to /usr/share/elasticsearch/data/elasticsearch #42

Open
jobrieniii opened this issue May 14, 2015 · 19 comments
Open

Comments

@jobrieniii
Copy link

Unable to launch elasticsearch container when trying to mount data to volume using Docker version 1.6.2, build 7c8fca2.

Simple example as shown in docs:

docker run -v "$PWD/esdata":/usr/share/elasticsearch/data elasticsearch

returns error (in this case I was using boot2docker):

- ElasticsearchIllegalStateException[Failed to obtain node lock, is the following location writable?: [/usr/share/elasticsearch/data/elasticsearch]]
    IOException[failed to obtain lock on /usr/share/elasticsearch/data/elasticsearch/nodes/49]
        IOException[Cannot create directory: /usr/share/elasticsearch/data/elasticsearch/nodes/49]

I also had tried similar command on centos 7 and get similar error (always goes back to the inability to write).

I had been running similar container run command with Docker version 1.5.0-dev, build fc0329b/1.5.0 a week or so ago - and had no problems.

Anyone seen this in recent docker builds?

@joshuacox
Copy link

possibly a perms issue, I'm having issues with the data dir as well.

chown -R elasticsearch. /usr/share/elasticsearch/data

from within the container, and that corrected some of my problems. That might correct your issues, alas elasticsearch is still not seeing my old data.

@tcabanski
Copy link

I see this error when using boot2docker on Mac with the latest image.

@joshuacox
Copy link

You might post the output of ls -lR /usr/share/elasticsearch/data from inside the container

@tcabanski
Copy link

I can't run a command on the container if I attach the volume because it fails during startup. If there's a way around that, please let me know. Here's the output without the volume attached:

Toms-MacBook-Pro:docker tom$ docker exec search ls -lR /usr/share/elasticsearch/data
/usr/share/elasticsearch/data:
total 4
drwxr-xr-x 3 elasticsearch elasticsearch 4096 Jun 7 16:32 elasticsearch

/usr/share/elasticsearch/data/elasticsearch:
total 4
drwxr-xr-x 3 elasticsearch elasticsearch 4096 Jun 7 16:32 nodes

/usr/share/elasticsearch/data/elasticsearch/nodes:
total 4
drwxr-xr-x 3 elasticsearch elasticsearch 4096 Jun 7 16:32 0

/usr/share/elasticsearch/data/elasticsearch/nodes/0:
total 4
drwxr-xr-x 2 elasticsearch elasticsearch 4096 Jun 7 16:32 _state
-rw-r--r-- 1 elasticsearch elasticsearch 0 Jun 7 16:32 node.lock

/usr/share/elasticsearch/data/elasticsearch/nodes/0/_state:
total 4
-rw-r--r-- 1 elasticsearch elasticsearch 67 Jun 7 16:32 global-1

@joshuacox
Copy link

docker ps -lq is that to grab the id of the last container ( in this case you should have started the ES container last), then docker logs -f $CONTANER_ID where CONTAINER_ID is what you got from the previous command, or throw this in your /usr/local/bin https://raw.githubusercontent.com/joshuacox/freezing-cyril/master/src/LogDockerLast
and what do the logs look like?

@tcabanski
Copy link

Logs are as follows:

[2015-06-10 12:10:59,770][INFO ][node ] [Arclight] version[1.4.5], pid[1], build[2aaf797/2015-04-27T08:06:06Z]
[2015-06-10 12:10:59,771][INFO ][node ] [Arclight] initializing ...
[2015-06-10 12:10:59,775][INFO ][plugins ] [Arclight] loaded [], sites []
{1.4.5}: Initialization Failed ...

  • ElasticsearchIllegalStateException[Failed to obtain node lock, is the following location writable?: [/usr/share/elasticsearch/data/elasticsearch]]
    IOException[failed to obtain lock on /usr/share/elasticsearch/data/elasticsearch/nodes/49]
    IOException[Cannot create directory: /usr/share/elasticsearch/data/elasticsearch/nodes/49]

@koogle
Copy link

koogle commented Jun 18, 2015

I can also confirm this issue
boot2docker/boot2docker#581 might be the reason

@whgibbo
Copy link

whgibbo commented Jun 26, 2015

I'm new to ElasticSearch.. I download it on a windows 8.1 system and I'm getting the same issue.
Tried on a Windows 7 system and no issues.

Save version of Java on both by the way.

@joshuacox
Copy link

I'd kind of like to know why variable data is being stored in /usr anyhow? It makes it look like we have no idea about unix conventions, nor that variable data is stored in /var

@richie5um
Copy link

In case it is helpful to anyone else, I used the tip provided by @bradgessler (boot2docker/boot2docker#581 (comment)). Adding this to my Dockerfile resolved the problem:
RUN -usermod 1000 elasticsearch

@joshuacox
Copy link

@richie5um did you mean perhaps?

RUN usermod -u 1000 elasticsearch

@richie5um
Copy link

@joshuacox Oh, yes, thanks. Fixed.

@Kamapcuc
Copy link

I have the same problem with new ES1.7 on Windows7 and "subst" disk.
ES1.4 works fine with subst.

@saxix
Copy link

saxix commented Feb 3, 2017

any updates on this issue ? I'm running the same on 5.1/5.2

@zelgerj
Copy link

zelgerj commented Feb 3, 2017

yes same here. are there any updates?

@wybrono
Copy link

wybrono commented Mar 17, 2017

I encountered the same problem, because there is another es process has been opened, not be killed

@zelgerj
Copy link

zelgerj commented Mar 17, 2017

so you got a solution or was is just a notice?

@matajaz
Copy link

matajaz commented Apr 10, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests