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): ``` diff --git a/docker/elasticsearch/Dockerfile b/docker/elasticsearch/Dockerfile new file mode 100644 index 0000000..2a91ae9 --- /dev/null +++ b/docker/elasticsearch/Dockerfile @@ -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 \ + 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 diff --git a/docker/elasticsearch/README.md b/docker/elasticsearch/README.md new file mode 100644 index 0000000..803bcf0 --- /dev/null +++ b/docker/elasticsearch/README.md @@ -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. +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.