Skip to content

Commit

Permalink
Merge branch 'release/6.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
yasuflatland-lf committed Apr 12, 2018
2 parents be831fe + 183a2af commit ae153ce
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 94 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# elasticsearch-docker-composer-for-liferay-7
This is for setting up docker-composer to test Elasticsearch and Kuromoji against Liferay 7 GA4 / DXP de32 (Elasticsearch 2.4). **This is ```oraclejdk8``` version. If you are looking for ```openjdk8``` version, please refer ```openjdk8``` branch of this repository.**
This is for setting up docker-composer to test Elasticsearch and Kuromoji against Liferay 7 GA6 / DXP de42 (Elasticsearch 6.1.3). **The JDK type (OpenJDK / OracleJDK) need to match between Elasticsearch and Liferay because Liferay using binary protocol to communicate with Elasticsearch. Master is ```Oracle jdk8``` version. If you are looking for ```${elasticsearch_version}_openjdk8``` version, please refer ```${elasticsearch_version}_openjdk8``` branch of this repository.**

If you are using lower than Liferay 7 GA6 / DXP de42, please use branch ```2.4_openjdk8``` or ```2.4_oraclejdk8``` depending on what version of JDK type (OpenJDK / OracleJDK) using for Liferay.

## Required environment
- Docker 17.06.2-ce >=
Expand Down Expand Up @@ -65,6 +67,7 @@ PUT /[index_name]/_settings
}
```
3. Search / index and you'll see log files under ./es/logs
you can also change ./es/config/elasticsearch.yml for above settings and run ```docker-compose up --build```

## Search from query to see how analyzer works.
1. Navigate to ```http://localhost:5601/app/sense``` and select server (http://elasticsearch:9200)
Expand All @@ -81,9 +84,5 @@ GET /[index_name]/_analyze
### Elasticsearch
```http://localhost:9200```

### Sense (Analyzing tool for Elasticsearch)
```http://localhost:5601/app/sense```
In Sense, for a server, set ```http://elasticsearch:9200``` to access the Elasticsearch server.

### Elastic-HQ
```http://localhost:9200/_plugin/hq```
### Kibana (Analyzing tool for Elasticsearch)
```http://localhost:5601```
19 changes: 15 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
version: "2"
version: "2.1"
services:
elasticsearch:
build: es
mem_limit: 4g
ports:
- "9200:9200"
- "9300:9300"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- ./es/data/:/usr/share/elasticsearch/data/
- ./es/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
- ./es/config/logging.yml:/usr/share/elasticsearch/config/logging.yml
- ./es/config/userdict_ja.txt:/usr/share/elasticsearch/config/userdict_ja.txt
- ./es/logs/:/var/log/elasticsearch/
environment:
- "ES_JAVA_OPTS: -Xmx2048m -Xms2048m"
- "ES_JAVA_OPTS=-Xms1g -Xmx1g"
- bootstrap.memory_lock=true
- xpack.security.enabled=false
- xpack.graph.enabled=false
- xpack.ml.enabled=false
- xpack.monitoring.enabled=true
- xpack.watcher.enabled=false

kibana:
image: seeruk/docker-kibana-sense:4.6
image: docker.elastic.co/kibana/kibana:6.1.4
ports:
- "5601:5601"
environment:
- ELASTICSEARCH_URL=http://elasticsearch:9200
- xpack.security.enabled=false
88 changes: 5 additions & 83 deletions es/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,84 +1,6 @@
FROM frolvlad/alpine-oraclejdk8
FROM docker.elastic.co/elasticsearch/elasticsearch:6.1.3

# ensure elasticsearch user exists
RUN addgroup -S elasticsearch && adduser -S -G elasticsearch elasticsearch

# grab su-exec for easy step-down from root
# and bash for "bin/elasticsearch" among others
RUN apk add --no-cache 'su-exec>=0.2' bash

# https://artifacts.elastic.co/GPG-KEY-elasticsearch
ENV GPG_KEY 46095ACC8548582C1A2699A9D27D666CD88E42B4

WORKDIR /usr/share/elasticsearch
ENV PATH /usr/share/elasticsearch/bin:$PATH

ENV ELASTICSEARCH_VERSION 2.4.6
ENV ELASTICSEARCH_TARBALL="https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-2.4.6.tar.gz" \
ELASTICSEARCH_TARBALL_ASC="https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-2.4.6.tar.gz.asc" \
ELASTICSEARCH_TARBALL_SHA1="c3441bef89cd91206edf3cf3bd5c4b62550e60a9"

RUN set -ex; \
\
apk add --no-cache --virtual .fetch-deps \
ca-certificates \
gnupg \
openssl \
tar \
; \
\
wget -O elasticsearch.tar.gz "$ELASTICSEARCH_TARBALL"; \
\
if [ "$ELASTICSEARCH_TARBALL_SHA1" ]; then \
echo "$ELASTICSEARCH_TARBALL_SHA1 *elasticsearch.tar.gz" | sha1sum -c -; \
fi; \
\
if [ "$ELASTICSEARCH_TARBALL_ASC" ]; then \
wget -O elasticsearch.tar.gz.asc "$ELASTICSEARCH_TARBALL_ASC"; \
export GNUPGHOME="$(mktemp -d)"; \
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY"; \
gpg --batch --verify elasticsearch.tar.gz.asc elasticsearch.tar.gz; \
rm -rf "$GNUPGHOME" elasticsearch.tar.gz.asc; \
fi; \
\
tar -xf elasticsearch.tar.gz --strip-components=1; \
rm elasticsearch.tar.gz; \
\
apk del .fetch-deps; \
\
mkdir -p ./plugins; \
for path in \
./data \
./logs \
./config \
./config/scripts \
; do \
mkdir -p "$path"; \
chown -R elasticsearch:elasticsearch "$path"; \
done; \
\
# we shouldn't need much RAM to test --version (default is 2gb, which gets Jenkins in trouble sometimes)
export ES_JAVA_OPTS='-Xms32m -Xmx32m'; \
if [ "${ELASTICSEARCH_VERSION%%.*}" -gt 1 ]; then \
elasticsearch --version; \
else \
# elasticsearch 1.x doesn't support --version
# but in 5.x, "-v" is verbose (and "-V" is --version)
elasticsearch -v; \
fi

COPY config ./config

VOLUME /usr/share/elasticsearch/data

COPY docker-entrypoint.sh /

EXPOSE 9200 9300
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["elasticsearch"]

RUN bin/plugin install analysis-kuromoji
RUN bin/plugin install analysis-icu
RUN bin/plugin install analysis-smartcn
RUN bin/plugin install analysis-stempel
RUN bin/plugin install royrusso/elasticsearch-HQ/v2.0.3
RUN elasticsearch-plugin install analysis-kuromoji
RUN elasticsearch-plugin install analysis-icu
RUN elasticsearch-plugin install analysis-smartcn
RUN elasticsearch-plugin install analysis-stempel
2 changes: 2 additions & 0 deletions es/config/elasticsearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,5 @@ discovery.zen.minimum_master_nodes: 1
# index.indexing.slowlog.threshold.index.trace: 500ms
# index.indexing.slowlog.level: info
# index.indexing.slowlog.source: 1000

xpack.security.enabled: false
1 change: 1 addition & 0 deletions es/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ if [ "$1" = 'elasticsearch' -a "$(id -u)" = '0' ]; then
for path in \
/usr/share/elasticsearch/data \
/usr/share/elasticsearch/logs \
/usr/share/elasticsearch \
; do
chown -R elasticsearch:elasticsearch "$path"
done
Expand Down

0 comments on commit ae153ce

Please sign in to comment.