Skip to content

Shield being installed in the wrong directory #79

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

Closed
ghost opened this issue Feb 1, 2016 · 10 comments
Closed

Shield being installed in the wrong directory #79

ghost opened this issue Feb 1, 2016 · 10 comments

Comments

@ghost
Copy link

ghost commented Feb 1, 2016

This may be a shield issue. After several hours trying to figure out why authentication wasn't working, I noticed there are two config directories in my elasticsearch container. The shield data files are installed in /etc/elasticsearch but they need to be in /usr/share/elasticsearch/config/.

To solve this I moved the shield directory to the right location. Wondering if there is a better solution…

FROM elasticsearch:2.1.1

# Add custom roles config
ADD ./roles.yml /etc/elasticsearch/shield/roles.yml

# Install Shield
RUN /usr/share/elasticsearch/bin/plugin install license
RUN /usr/share/elasticsearch/bin/plugin install shield

# Create user 
RUN /usr/share/elasticsearch/bin/shield/esusers useradd abc -r abc -p xyzxyz

# Move shield files to the right location
RUN mv /etc/elasticsearch/shield /usr/share/elasticsearch/config/shield
@rsingh2411
Copy link

Hi This is not working with given workaround also its throwing an authentication error

{"error":{"root_cause":[{"type":"security_exception","reason":"unable to authenticate user [esuser] for REST request [/]","header":{"WWW-Authenticate":"Basic realm="shield""}}],"type":"security_exception","reason":"unable to authenticate user [esuser] for REST request [/]","header":{"WWW-Authenticate":"Basic realm="shield""}},"status":401}

I checked user and every thing seems fine

@rsingh2411
Copy link

I was able to use this fix and it worked, only thing this time around i did was used above docker file as mentioned by William,

Earlier i was using the standard elastic search docker file which had step from java installation and installing elastic search binary, then added plugins installation, I wonder why didn't that work. as in above docker file we are extending the same standard elastic search docker file

@lcdavidson
Copy link

I may be seeing the same issue

@baboune
Copy link

baboune commented Apr 1, 2016

I have the same issue. And the "fix" of moving
RUN mv /etc/elasticsearch/shield /usr/share/elasticsearch/config/shield
Does not work:

ERROR: The configuration directory [/etc/elasticsearch/shield] does not exist. The esusers tool expects Shield configuration files in that location.
The plugin may not have been installed with the correct configuration path. If [/usr/share/elasticsearch/config/shield] exists, please copy the shield directory to [/etc/elasticsearch]

@rv-gava
Copy link

rv-gava commented Apr 5, 2016

Guys, the same problem and the same workaround works for me!

@julienmathevet
Copy link

julienmathevet commented May 3, 2016

+1 same issue, workaround didn't work for me for x-pack

@OscarBarrett
Copy link

Moving the shield directory worked fine for me (using elasticsearch:latest). Make sure you add a user as well. I call the following before moving the directory:

/usr/share/elasticsearch/bin/shield/esusers useradd $ES_USERNAME -r admin -p "$ES_PASSWORD"

@up9cloud
Copy link

mount the config dir both to the /etc/elasticsearch and /usr/share/elasticsearch/config should work fine.

docker run -d \
-v /path/to/config:/etc/elasticsearch \
-v /path/to/config:/usr/share/elasticsearch/config \
elasticsearch:2

@shrenikgala
Copy link

Will this workaround work if you want to create a new user after you have moved your shield files to /usr/share/elasticsearch/config/shield

@tianon
Copy link
Member

tianon commented Oct 4, 2017

This image is officially deprecated in favor of upstream's images (see https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html).

For more information, please see #160, docker-library/docs#842, and docker-library/docs#945.

This image has been deprecated in favor of the official elasticsearch image provided and maintained by elastic.co. The upstream images are available to pull via docker.elastic.co/elasticsearch/elasticsearch:[version] like 5.4.2. The images found here will receive no further updates once the 5.6.0 release is available upstream. Please adjust your usage accordingly.

Elastic provides open-source support for Elasticsearch via the elastic/elasticsearch GitHub repository and the Docker image via the elastic/elasticsearch-docker GitHub repository, as well as community support via its forums.

Thanks!

@tianon tianon closed this as completed Oct 4, 2017
1gtm pushed a commit to appscode-images/elasticsearch that referenced this issue Feb 14, 2024
This commit was created by the elastic-dockerfiles-publisher.
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

9 participants