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

How to install plugin? #32

Closed
Gwill opened this issue Jun 1, 2015 · 14 comments
Closed

How to install plugin? #32

Gwill opened this issue Jun 1, 2015 · 14 comments

Comments

@Gwill
Copy link

Gwill commented Jun 1, 2015

How to install plugin?

I have config like this http://www.codedependant.net/2015/01/17/install-elastic-search-plugins-through-docker/ .

And when I have finished install plugin(the plugin files is already in volume path), i start ES, request plugin it return 400.

@yosifkit
Copy link
Member

yosifkit commented Jun 1, 2015

That walkthrough is for dockerfile/elasticsearch, not the official image elasticsearch. You will probably just need to change all the container paths from /data to /usr/share/elasticsearch/data. I am not entirely sure on the config file placement since there is a /usr/share/elasticsearch/config directory.

@Gwill
Copy link
Author

Gwill commented Jun 2, 2015

So how to install plugin?

@ebuildy
Copy link
Contributor

ebuildy commented Jun 4, 2015

You can use docker exec or create your own Docker image, that overrides this one.

Then refer to traditional elastic documentation to see the plugin installation syntax.

@wgriffiths
Copy link

Heres an example of how I installed the head plugin

  1. Start container with volume for plugins and es as its name
docker run -d -P  -p 9200:9200 -p 9300:9300 --name "es" -v "$PWD/es/plugins":/usr/share/elasticsearch/plugins elasticsearch 
  1. Install head plugin
docker exec es /usr/share/elasticsearch/bin/plugin -install mobz/elasticsearch-head

Hope this helps

@Gwill
Copy link
Author

Gwill commented Jun 7, 2015

@wgriffiths , Thanks!

@Gwill Gwill closed this as completed Jun 7, 2015
@ibraheeamm
Copy link

ibraheeamm commented Mar 24, 2016

@wgriffiths the second command depends on your elasticsearch version
if you are using 2.0 then use the same command without the dash character before install
docker exec es /usr/share/elasticsearch/bin/plugin install mobz/elasticsearch-head

Hope this helps

Update

Edited the command after this comment

So I think the command becomes docker exec es /usr/share/elasticsearch/bin/elasticsearch-plugin install mobz/elasticsearch-head

Thanks everyone and hopes it helps

@nuest
Copy link

nuest commented Aug 18, 2016

After the last comment here, an official blog post was published:

https://www.elastic.co/blog/elasticsearch-docker-plugin-management

Hope this helps

@harobed
Copy link

harobed commented Aug 25, 2016

I'm suggest to append this link ( https://www.elastic.co/blog/elasticsearch-docker-plugin-management ) in README

@lambdaq
Copy link

lambdaq commented Feb 8, 2017

In case anyone else is running the latest container

docker pull elasticsearch

Somehow the command was changed to /usr/share/elasticsearch/bin/elasticsearch-plugin

5.2 breaks tons of plugins including their own "Marvel" plugin.

@yosifkit
Copy link
Member

yosifkit commented Feb 8, 2017

Looks like the change from plugin -> elasticsearch-plugin was back in 5.0. Note that /usr/share/elasticsearch/bin/ is in the PATH on all of the images, so you can use plugin on the 1 and 2 series and elasticsearch-plugin on 5 and up.

@dixon1e
Copy link

dixon1e commented Jan 20, 2018

The executable path is correct, but the plugins themselves are not found. Docs say these plugins were moved into X-Pack: https://www.elastic.co/guide/en/marvel/current/installing-marvel.html

@henrywallace
Copy link

henrywallace commented Jun 20, 2018

I ran into this same problem with elasticsearch:5.6. And #32 (comment) indeed was the solution.

For prosperities sake, here's how I debugged the problem:

I had a docker file

FROM elasticsearch:5.6

COPY my-plugin.zip /
RUN /usr/share/elasticsearch/bin/plugin install file:///my-plugin.zip

But, I would get the following

$ docker build . -t elasticsearch:my-plugin
Sending build context to Docker daemon  24.37MB
Step 1/5 : FROM elasticsearch:5.6
 ---> 9b44bde11dd8
Step 2/5 : COPY my-plugin.zip /
 ---> Using cache
 ---> a27fd93eddb0
Step 3/5 : RUN /usr/share/elasticsearch/bin/plugin install file:///my-plugin.zip
 ---> Running in 78ccd46dcc6b
/bin/sh: 1: /usr/share/elasticsearch/bin/plugin: not found
The command '/bin/sh -c /usr/share/elasticsearch/bin/plugin install file:///my-plugin.zip' returned a non-zero code: 127

So I took the intermediate hash a27fd93eddb0 and did the following:

$ docker run --rm --it a27fd93eddb0 bash
[root@43211f8792a3:/usr/share/elasticsearch]# ls -h /usr/share/elasticsearch/bin/
elasticsearch			elasticsearch-plugin			elasticsearch-translog
elasticsearch-keystore	elasticsearch-systemd-pre-exec	elasticsearch.in.sh

Thar she blows! It's elasticsearch-plugin not plugin.

See also: https://stackoverflow.com/a/26222636/2601179

@olidaver
Copy link

olidaver commented Sep 4, 2019

@wgriffiths the second command depends on your elasticsearch version
if you are using 2.0 then use the same command without the dash character before install
docker exec es /usr/share/elasticsearch/bin/plugin install mobz/elasticsearch-head

Hope this helps

Thank you, vefy helpful for me.

@worldsayshi
Copy link

In later versions /usr/share/elasticsearch/bin/plugin has been changed to /usr/share/elasticsearch/bin/elasticsearch-plugin.

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