Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

docker image for elasticsearch #39

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"use the prepared"


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:

Expand Down Expand Up @@ -94,7 +99,7 @@ $ ./bin/elasticsearch
[2017-09-08T15:58:20,676][INFO ][o.e.n.Node ] initialized
...
```

#### 2.2 Elasticsearch python install
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Install the Elasticsearch Python client"

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):

```
Expand Down
7 changes: 7 additions & 0 deletions docker/elasticsearch/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM docker.elastic.co/elasticsearch/elasticsearch:5.3.0

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 \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this required? Is it a licensing issue?

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
29 changes: 29 additions & 0 deletions docker/elasticsearch/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#### 2.0 Start Elasticsearch with docker
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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

familier -> familiar

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"... with the elasticsearch-vector-scoring plugin installed"

Just go to docker/elasticsearch/ directory where you can find the ```Dockerfile``` and build the image with
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps use single backticks for Dockerfile?

```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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Once the image has been built, run the image using the following command:"

Check that the `elasticsearch-vector-scoring-plugin` is successfully loaded and elasticsearch is started:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps put "Elasticsearch is started" first, i.e. "Check that Elasticsearch has started and the ... "


```
$ 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Provide a link back to the relevant section of the main README