elastic / stack-docker

Project no longer maintained.
Apache License 2.0
1.18k stars 450 forks source link

Elasticsearch 7.x support #95

Open ewoks opened 5 years ago

ewoks commented 5 years ago

Missing support for Elasticsearch 7.x which is the newest version. Simple update of versions in .ENV file to 7.0.1 renders following error:

ERROR: for elasticsearch Cannot create container for service elasticsearch: invalid mount config for type "bind": bind source path does not exist: /Users/<CurrentUser>/temp/es-docker-full/stack-docker/config/ssl/ca/ca.crt

LouisLetcher commented 5 years ago

any news?

korjavin commented 5 years ago

Does it depend of version?

r00t1ng commented 5 years ago

Hey guys. I have tried changing the tag in the environment to match 7.2.0 however I am getting the same error as ewoks.

sikevux commented 5 years ago

The error seems to cascade from this line: https://github.com/elastic/stack-docker/blob/2fb363377ae6abd56ccc250524eca26eaa74c841/scripts/setup-elasticsearch.sh#L41

Basically the newer images seems to be missing unzip and thus the certs are never unpacked and this cascades to the error you're seeing.

To get it to work just do something like this:

diff --git a/scripts/setup-elasticsearch.sh b/scripts/setup-elasticsearch.sh
index a88222a..0648ea0 100755
--- a/scripts/setup-elasticsearch.sh
+++ b/scripts/setup-elasticsearch.sh
@@ -37,6 +37,10 @@ if [[ -n "$ELASTIC_PASSWORD" ]]; then
         echo "CA directory exists, removing..."
         rm -rf /config/ssl/ca
     fi
+    echo "Install unzip if needed..."
+    if ! command -v unzip &>/dev/null; then
+       yum -qy install unzip
+    fi
     echo "Unzip ca files..."
     unzip /config/ssl/docker-cluster-ca.zip -d /config/ssl
kinzleb commented 5 years ago

In order to get 7.2.0 to work for me I had to make the change @sikevux shows above, and these:

  1. The cluster wasn’t electing a master, it appeared to be because we now need to set cluster.initial_master_nodes and we also need the value set in it to exactly match the node.name:

Add to docker-compose.yml (line 23)

    environment:
      - cluster.initial_master_nodes=elasticsearch

Add to elasticsearch.yml (line 4)

node.name: elasticsearch
  1. The kibana.yml seemed to change with the new version to now want elasticsearch.hosts instead of elasticsearch.url:

Change kibana.yml (line 5): old

elasticsearch.url: https://elasticsearch:9200

new

elasticsearch.hosts: ["https://elasticsearch:9200"]
  1. The check to see if x-pack is enabled needs modified because the directory it used to look for isn’t there anymore — I just changed it to check for the existence of a x-pack file instead:

Change setup-elasticsearch.sh (line 10): old

if [[ -d /usr/share/elasticsearch/bin/x-pack ]]; then

new

if [[ -f /usr/share/elasticsearch/bin/x-pack-env ]]; then

I should note that I was only interested in getting elasticsearch and kibana up and running at this point so I removed all of the other services this brings up and didn’t work through any issues you may encounter with them. After making the above changes though I was able to successfully login to the kibana from a browser.

kartheekmannepalli commented 5 years ago

I still get the same error after trying the above changes mentioned by kinzleb and sikevux. It does try to create the keystore and crt files but fails. Did anyone else find a way to get this working?

smcllc commented 5 years ago

I tried to update this for 7.3.2 and I get the crt errors too. I tried all of the fixes listed here and it just causes more issues. Is anyone maintaining this? I would love to be able to run this for a POC.

miaozhongyin commented 4 years ago

i still get the same error when i install elasticsearch:7.4.1 docker image. it's seem that this current version can not support 7.X . if you want continue use 7.X ,you can delete all about sercurty configure in docker-compose.yaml and other config file. then restart elasticsearch service. i test it's worked.

ovizii commented 4 years ago

I need to deploy the more or less compelte ELK stack on one machine, just for testing purposes so this docker-compose.yml here seemed to incldue about everything needed for testing but its for an older 6.x version.

Does anyone have a docker-compose.yml for the 7.x versio navailable for testing purposes?

LouisLetcher commented 4 years ago

I need to deploy the more or less compelte ELK stack on one machine, just for testing purposes so this docker-compose.yml here seemed to incldue about everything needed for testing but its for an older 6.x version.

Does anyone have a docker-compose.yml for the 7.x versio navailable for testing purposes?

I have one but need to push it to a github repo. Will add later the link

Jhutterer commented 4 years ago

I ran through the changes in this post, I still can't get it to work @LouisLetcher any chance you have pushed that docker-compose.yml anywhere?