-
Notifications
You must be signed in to change notification settings - Fork 735
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First step to upgrade Elastic to elasticsearch 5.0
In this first step, all tests are checked which are not compatible with elasticsearch 5.0. Either the tests are directly fixed or they are temporarely skipped and have to be cleaned up later. In general it seems as most of the things will just keep working with elasticsearch 5.0 except for the things that were changed / removed in elasticsearch 5.0 anyways (like mapping changes from string to text / keyword). * Replace remove count search type by query_then_fetch * Replace optimize by forcemerge as optimize was removed * Rename getMock() to createMock() to be compatible with newer phpunit versions * Convert string mapping to text * Change delete-by-query implementation to use 5.0 api * Remove delete-by-query plugin checks as now installed by default * Change script implementation to new 5.0 implementation * Simplify update-document * Update test environment to use self built elasticsearch instance * Improve node info fetching to use new format * Skip plugin tests if no plugin available * Fix list of tests * Apply liniting * Fix script tests for new script structure * Remove search_type from scroll as not needed anymore * Update README.md with new dependency Part of #1184
- Loading branch information
Showing
60 changed files
with
296 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,54 @@ | ||
FROM elasticsearch:2.4.0 | ||
FROM java:8-jre | ||
MAINTAINER Nicolas Ruflin <[email protected]> | ||
|
||
# Dependencies | ||
ENV ELASTICSEARCH_VERSION 2.4.0 | ||
ENV ES_IMAGE_PLUGIN_VER 1.7.1 | ||
ENV ES_PLUGIN_BIN /usr/share/elasticsearch/bin/plugin | ||
ENV VERSION 5.0.0-rc1 | ||
|
||
# Install Plugins | ||
RUN ${ES_PLUGIN_BIN} install mapper-attachments | ||
RUN ${ES_PLUGIN_BIN} install delete-by-query | ||
#RUN ${ES_PLUGIN_BIN} install image --url https://github.com/Jmoati/elasticsearch-image/releases/download/${ES_IMAGE_PLUGIN_VER}/elasticsearch-image-${ES_IMAGE_PLUGIN_VER}.zip | ||
ENV URL https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${VERSION}.tar.gz | ||
|
||
# Cache variable can be set during building to invalidate the build cache with `--build-arg CACHE=$(date +%s) .` | ||
ARG CACHE=1 | ||
|
||
ENV ESHOME /opt/elasticsearch-${VERSION} | ||
ENV ES_PLUGIN_BIN ${ESHOME}/bin/elasticsearch-plugin | ||
|
||
# grab gosu for easy step-down from root | ||
RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 | ||
RUN arch="$(dpkg --print-architecture)" \ | ||
&& set -x \ | ||
&& curl -o /usr/local/bin/gosu -fSL "https://github.com/tianon/gosu/releases/download/1.3/gosu-$arch" \ | ||
&& curl -o /usr/local/bin/gosu.asc -fSL "https://github.com/tianon/gosu/releases/download/1.3/gosu-$arch.asc" \ | ||
&& gpg --verify /usr/local/bin/gosu.asc \ | ||
&& rm /usr/local/bin/gosu.asc \ | ||
&& chmod +x /usr/local/bin/gosu | ||
|
||
RUN groupadd -r elasticsearch && useradd -r -m -g elasticsearch elasticsearch | ||
|
||
RUN set -x && \ | ||
cd /opt && \ | ||
wget -qO elasticsearch.tar.gz "$URL?${CACHE}" && \ | ||
tar xzvf elasticsearch.tar.gz && \ | ||
chown -R elasticsearch:elasticsearch ${ESHOME} | ||
|
||
ENV PATH ${ESHOME}/bin:$PATH | ||
|
||
# Debug interface | ||
# RUN ${ES_PLUGIN_BIN} install mobz/elasticsearch-head | ||
VOLUME ${ESHOME}/data | ||
|
||
ENV ES_JAVA_OPTS="-Xms512m -Xmx512m" | ||
|
||
RUN ${ES_PLUGIN_BIN} install mapper-attachments | ||
|
||
# Copy config files | ||
COPY *.yml /usr/share/elasticsearch/config/ | ||
COPY scripts/* /usr/share/elasticsearch/config/scripts/ | ||
|
||
COPY docker-entrypoint.sh / | ||
|
||
ENTRYPOINT ["/docker-entrypoint.sh"] | ||
|
||
|
||
RUN mkdir -p /tmp/backups/backup1 | ||
RUN mkdir -p /tmp/backups/backup2 | ||
|
||
# Expose standard ports | ||
EXPOSE 9200 9300 | ||
|
||
CMD ["elasticsearch"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Add elasticsearch as command if needed | ||
if [ "${1:0:1}" = '-' ]; then | ||
set -- elasticsearch "$@" | ||
fi | ||
|
||
# Drop root privileges if we are running elasticsearch | ||
if [ "$1" = 'elasticsearch' ]; then | ||
# Change the ownership of /usr/share/elasticsearch/data to elasticsearch | ||
chown -R elasticsearch:elasticsearch ${ESHOME-/usr/share/elasticsearch}/data | ||
exec gosu elasticsearch "$@" | ||
fi | ||
|
||
# As argument is not related to elasticsearch, | ||
# then assume that user wants to run his own process, | ||
# for example a `bash` shell to explore this image | ||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
* Elastica index template object. | ||
* | ||
* @author Dmitry Balabka <[email protected]> | ||
* | ||
* | ||
* @link https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html | ||
*/ | ||
class IndexTemplate | ||
|
@@ -113,7 +113,7 @@ public function getClient() | |
*/ | ||
public function request($method, $data = []) | ||
{ | ||
$path = '/_template/'.$this->getName(); | ||
$path = '_template/'.$this->getName(); | ||
|
||
return $this->getClient()->request($path, $method, $data); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.