Coder Social home page Coder Social logo

Comments (5)

k1xme avatar k1xme commented on May 18, 2024

this issue is duplicate to #5 .

from elasticsearch.

kadishmal avatar kadishmal commented on May 18, 2024

I am having a similar issue:

$ docker run elasticsearch:1.4.5 elasticsearch
[2015-10-30 06:01:06,939][INFO ][node                     ] [Molten Man] version[1.4.5], pid[1], build[2aaf797/2015-04-27T08:06:06Z]
[2015-10-30 06:01:06,940][INFO ][node                     ] [Molten Man] initializing ...
[2015-10-30 06:01:06,947][INFO ][plugins                  ] [Molten Man] 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]
naverui-MacBook-Pro-6:elasticsearch-docker naver$ docker run --rm elasticsearch:1.4.5 id elasticsearch
uid=105(elasticsearch) gid=108(elasticsearch) groups=108(elasticsearch)

Using Docker Toolbox with the default VirtualBox machine. Can't start even with default configurations despite not using the volume mounts.

If it's duplicate of #5, then what is the solution? The README says to run docker run -d elasticsearch which doesn't work out of the box.

from elasticsearch.

Garito avatar Garito commented on May 18, 2024

This is a recursive duplication error right now (not the elasticsearch error but the issue citation)
We can't find a good solution anywhere

from elasticsearch.

david-mohr avatar david-mohr commented on May 18, 2024

Here's my workaround for OSX using Docker Toolbox: Change the UID of the elasticsearch container user to match the docker UID of the VirtualBox machine and then use a quick script to sure up the permissions in the container to use the new UID. You could build your own image to implement this or you could use the following scripts and docker command to use the default elasticsearch image:

fix-perm-osx.sh

OLD_ES_UID=$(id -u elasticsearch)
echo "OLD elasticsearch UID: ${OLD_ES_UID}"
usermod -u ${OSX_DOCKER_UID} elasticsearch
echo "NEW elasticsearch UID: $(id -u elasticsearch)"
find / -uid ${OLD_ES_UID} -exec chown elasticsearch {} \; 2>/dev/null
exec /docker-entrypoint.sh "$@"

Then execute the container and you should be able to successfully mount the data directory:

docker run -d -e "OSX_DOCKER_UID=$(docker-machine ssh default id -u)" -v "$PWD/fix-perm-osx.sh":/fix-perm-osx.sh -v "$PWD/data":/usr/share/elasticsearch/data elasticsearch /fix-perm-osx.sh elasticsearch

from elasticsearch.

akobler avatar akobler commented on May 18, 2024

@david-mohr great, that works for me. One little adaption: I had to single-quote the 'id -u' as below.

docker run -d -e "OSX_DOCKER_UID=$(docker-machine ssh default 'id -u')  -v "$PWD/fix-perm-osx.sh":/fix-perm-osx.sh -v "$PWD/data":/usr/share/elasticsearch/data elasticsearch /fix-perm-osx.sh elasticsearch" 

from elasticsearch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.