I’m attempting to run an Elasticsearch container on Ubuntu 16, and on startup it attempts to access a data directory at
/usr/share/elasticsearch/data where it runs in to a bunch of errors like these.
Caused by: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/data/nodes/0/node.lock
First off, it didn’t even create the directory, so I created it. Then I recursively changed the owner:group to root:docker and
chmoded the group permissions to
rwx, so that the docker group had full permissions on it. Both myself and the project user are members of the docker group.
drwxrwxr-x 3 root docker 4096 Feb 7 13:23 elasticsearch
So, I’m not quite sure what’s going on here. There isn’t a separate docker user registered, so why does the container process not have privileges in the data directory? I see some people on the Github saying to just
chmod to 777, but that’s obviously not a serious solution. There’s gotta be something I’m missing here.