From afc6ff824814811e6524bc84b148fd40c18eea5a Mon Sep 17 00:00:00 2001 From: lazloz92 Date: Wed, 9 May 2018 09:07:13 +0200 Subject: [PATCH 1/7] Create a README.md for docker elasticsearch --- docker/elasticsearch/README.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 docker/elasticsearch/README.md diff --git a/docker/elasticsearch/README.md b/docker/elasticsearch/README.md new file mode 100644 index 0000000..0514e07 --- /dev/null +++ b/docker/elasticsearch/README.md @@ -0,0 +1,5 @@ +#### 2.0 Start Elasticsearch with docker +If you familier with docker you can use the elasticsearch docker image with installed elasticsearch-vector-scoring plugin. +Just build the image with +```docker build es-with-vector-scoring``` +and start the image with ```docker run -p 9200:9200 -p 9300:9300 elasticsearch-vector-scoring``` From 959e8085f2498e8687842f27bb30fdb17124d835 Mon Sep 17 00:00:00 2001 From: lazloz92 Date: Wed, 9 May 2018 09:09:15 +0200 Subject: [PATCH 2/7] Create Docker file for elasticsearch + vector plugin --- docker/elasticsearch/Dockerfile | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 docker/elasticsearch/Dockerfile diff --git a/docker/elasticsearch/Dockerfile b/docker/elasticsearch/Dockerfile new file mode 100644 index 0000000..db65fc3 --- /dev/null +++ b/docker/elasticsearch/Dockerfile @@ -0,0 +1,8 @@ +FROM docker.elastic.co/elasticsearch/elasticsearch:5.3.0 +MAINTAINER ApertusIT + +RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install https://github.com/MLnick/elasticsearch-vector-scoring/releases/download/v5.3.0/elasticsearch-vector-scoring-5.3.0.zip +RUN \ + mv /usr/share/elasticsearch/plugins/x-pack /usr/share/elasticsearch/plugins/.removing-x-pack && \ + mv /usr/share/elasticsearch/plugins/.removing-x-pack /usr/share/elasticsearch/plugins/x-pack && \ + /usr/share/elasticsearch/bin/elasticsearch-plugin remove x-pack From d47eb5c3fe5ff417670de4e3da86f9896bd72de4 Mon Sep 17 00:00:00 2001 From: lazloz92 Date: Wed, 9 May 2018 09:11:14 +0200 Subject: [PATCH 3/7] Update README for docker usage --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index eabb656..14cf95a 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,12 @@ $ git clone https://github.com/IBM/elasticsearch-spark-recommender.git ### 2. Set up Elasticsearch -This Code Pattern currently depends on Elasticsearch 5.3.0. Go to the [downloads page](https://www.elastic.co/downloads/past-releases/elasticsearch-5-3-0) and download the appropriate package for your system. +This Code Pattern currently depends on Elasticsearch 5.3.0. + +#### 2.1 Install Elasticsearch on your machine +(You can skip this if you want to use prepared docker image see: ./docker/elasticsearch/README.md) + +Go to the [downloads page](https://www.elastic.co/downloads/past-releases/elasticsearch-5-3-0) and download the appropriate package for your system. For example on Linux / Mac you can download the [TAR archive](https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.3.0.tar.gz) and unzip it using the commands: @@ -94,7 +99,7 @@ $ ./bin/elasticsearch [2017-09-08T15:58:20,676][INFO ][o.e.n.Node ] initialized ... ``` - +#### 2.2 Elasticsearch python install Finally, you will need to install the Elasticsearch Python client. You can do this by running the following command (you should do this in a separate terminal window to the one running Elasticsearch): ``` From 7f334ec8a966b677dd9853af25d65121d10f8e47 Mon Sep 17 00:00:00 2001 From: lazloz92 Date: Wed, 9 May 2018 11:09:47 +0200 Subject: [PATCH 4/7] Update docker README.md --- docker/elasticsearch/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/elasticsearch/README.md b/docker/elasticsearch/README.md index 0514e07..90d730f 100644 --- a/docker/elasticsearch/README.md +++ b/docker/elasticsearch/README.md @@ -2,4 +2,4 @@ If you familier with docker you can use the elasticsearch docker image with installed elasticsearch-vector-scoring plugin. Just build the image with ```docker build es-with-vector-scoring``` -and start the image with ```docker run -p 9200:9200 -p 9300:9300 elasticsearch-vector-scoring``` +and start the image with ```docker run -p 9200:9200 -p 9300:9300 es-with-vector-scoring``` From d0a5229e7aa836bd45c57a7bc6307ada430c1136 Mon Sep 17 00:00:00 2001 From: lazloz92 Date: Wed, 9 May 2018 11:13:33 +0200 Subject: [PATCH 5/7] Update docker README.md --- docker/elasticsearch/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/elasticsearch/README.md b/docker/elasticsearch/README.md index 90d730f..a43764c 100644 --- a/docker/elasticsearch/README.md +++ b/docker/elasticsearch/README.md @@ -1,5 +1,5 @@ #### 2.0 Start Elasticsearch with docker If you familier with docker you can use the elasticsearch docker image with installed elasticsearch-vector-scoring plugin. Just build the image with -```docker build es-with-vector-scoring``` +```docker build -t es-with-vector-scoring .``` and start the image with ```docker run -p 9200:9200 -p 9300:9300 es-with-vector-scoring``` From 8c0df471802d6152944d940f9beff5c11ade76c7 Mon Sep 17 00:00:00 2001 From: lazloz92 Date: Wed, 9 May 2018 21:03:43 +0200 Subject: [PATCH 6/7] Update README with logs and docker es link --- docker/elasticsearch/README.md | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/docker/elasticsearch/README.md b/docker/elasticsearch/README.md index a43764c..803bcf0 100644 --- a/docker/elasticsearch/README.md +++ b/docker/elasticsearch/README.md @@ -1,5 +1,29 @@ #### 2.0 Start Elasticsearch with docker -If you familier with docker you can use the elasticsearch docker image with installed elasticsearch-vector-scoring plugin. -Just build the image with -```docker build -t es-with-vector-scoring .``` -and start the image with ```docker run -p 9200:9200 -p 9300:9300 es-with-vector-scoring``` +If you familier with docker you can use the [elasticsearch docker image](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html) with installed elasticsearch-vector-scoring plugin. +Just go to docker/elasticsearch/ directory where you can find the ```Dockerfile``` and build the image with +```docker build -t es-with-vector-scoring .``` command. +Check that the image is successfully built: +``` +$ docker build -t es-with-vector-scoring . + Sending build context to Docker daemon 5.12kB + Step 1/3 : FROM docker.elastic.co/elasticsearch/elasticsearch:5.3.0 + ... + Successfully built 53ee57082cb8 + Successfully tagged es-with-vector-scoring:latest +``` + + +If builds ended you can start the image with ```docker run -p 9200:9200 -p 9300:9300 es-with-vector-scoring``` command. +Check that the `elasticsearch-vector-scoring-plugin` is successfully loaded and elasticsearch is started: + +``` +$ docker run -p 9200:9200 -p 9300:9300 es-with-vector-scoring + [2018-05-09T18:58:24,901][INFO ][o.e.n.Node ] [] initializing ... + ... + [2018-05-09T18:58:29,089][INFO ][o.e.p.PluginsService ] [Zs-WKd8] loaded plugin [elasticsearch-vector-scoring] + ... + [2018-05-09T18:58:36,108][INFO ][o.e.n.Node ] [Zs-WKd8] started + ... +``` + +Now that you've got Elasticsearch up and running, you can go back to step 2.2. From 4fd970544f8ef1658ee74aa01598d8d4fef9c4b8 Mon Sep 17 00:00:00 2001 From: lazloz92 Date: Wed, 9 May 2018 21:04:16 +0200 Subject: [PATCH 7/7] delete maintainer line from Dockerfile --- docker/elasticsearch/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/docker/elasticsearch/Dockerfile b/docker/elasticsearch/Dockerfile index db65fc3..2a91ae9 100644 --- a/docker/elasticsearch/Dockerfile +++ b/docker/elasticsearch/Dockerfile @@ -1,5 +1,4 @@ FROM docker.elastic.co/elasticsearch/elasticsearch:5.3.0 -MAINTAINER ApertusIT RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install https://github.com/MLnick/elasticsearch-vector-scoring/releases/download/v5.3.0/elasticsearch-vector-scoring-5.3.0.zip RUN \