nshou / elasticsearch-kibana

Simple and lightweight docker image for previewing Elasticsearch and Kibana.
https://hub.docker.com/r/nshou/elasticsearch-kibana
MIT License
46 stars 24 forks source link

Unable to install elasticsearch plugins #2

Closed nshou closed 5 years ago

nshou commented 5 years ago

(Original issue 2 created by None on 2018-01-19T11:18:07.156633+00:00)

~ $ elasticsearch/bin/elasticsearch-plugin install x-pack sh: elasticsearch/bin/elasticsearch-plugin: not found

nshou commented 5 years ago

(Original issue 2 last updated on 2018-07-16T09:01:56.997043+00:00)

(Issue automaticaly closed due to status in Bitbucket: resolved)

nshou commented 5 years ago

(Original comment by nshou on 2018-02-11T06:59:22.363558+00:00)

You need to specify using sh explicitly.

~ $ sh elasticsearch/bin/elasticsearch-plugin install x-pack

The script has bash at its shebang but the alpine container, which this container is based on, does not have bash installed.

As for the scripts in branches of kibana4 and kibana5, however, they are not compatible with POSIX sh (using bash-specific features.) So you need to install bash in the first place.

docker exec -u root CONTAINERID apk add --no-cache bash
nshou commented 5 years ago

(Original comment by nshou on 2018-07-09T02:31:29.661258+00:00)

I am going to close this ticket if you no longer experience the issue, thank you.

idanmid15 commented 4 years ago

When executing /home/elasticsearch/elasticsearch # sh bin/elasticsearch-plugin install x-pack I get the following error: bin/elasticsearch-plugin: line 6: bin/elasticsearch-cli: not found any ideas?

nshou commented 4 years ago

Hello,

Since Elastic's developer teams seem to have recently been inclined to use bash-specific expressions (not POSIX compliant) in their scripts, it is getting harder to run the scrips with 'sh' in Alpine container. So I suggest you would pull the latest version of this container image coming with ES/Kibana 7.7.0, which is based on Debian image with 'bash' installed, so that you may be free from any trouble on 'sh' vs. 'bash'.

However, you will still experience another error when you install x-pack in the latest container that would look like:

elasticsearch@12e127e2865b:~/elasticsearch-7.7.0$ bin/elasticsearch-plugin install x-pack
-> Installing x-pack
-> Failed installing x-pack
ERROR: X-Pack is not available with the oss distribution; to use X-Pack features use the default distribution

This is because this container uses OSS distribution of ES/Kibana to avoid Elastic's complicated licensing. You can build your own image that includes the default distribution of ES/Kibana as follows:

git clone https://github.com/nshou/elasticsearch-kibana.git
cd elasticsearch-kibana
sed -i 's/oss-//' Dockerfile
docker build -t nonoss-ek .
docker run -d -p 9200:9200 -p 5601:5601 nonoss-ek

After entering the container (e.g. docker exec -it <CONTAINERID> /bin/bash), you can get full control over the default distribution version.

idanmid15 commented 4 years ago

Thank you!