-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
1,303 additions
and
932 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Password for the 'elastic' user (at least 6 characters) | ||
ELASTIC_PASSWORD= | ||
|
||
# Password for the 'kibana_system' user (at least 6 characters) | ||
KIBANA_PASSWORD= | ||
|
||
# Version of Elastic products | ||
STACK_VERSION=7.17.1 | ||
|
||
# Set the cluster name | ||
CLUSTER_NAME=LiferayElasticsearchCluster | ||
|
||
# Set to 'basic' or 'trial' cdto automatically start the 30-day trial | ||
LICENSE=basic | ||
#LICENSE=trial | ||
|
||
# Port to expose Elasticsearch HTTP API to the host | ||
ES_PORT=9200 | ||
#ES_PORT=127.0.0.1:9200 | ||
|
||
# Port to expose Kibana to the host | ||
KIBANA_PORT=5601 | ||
#KIBANA_PORT=80 | ||
|
||
# Increase or decrease based on the available host memory (in bytes) | ||
MEM_LIMIT=1073741824 | ||
|
||
# Project namespace (defaults to the current folder name if not set) | ||
#COMPOSE_PROJECT_NAME=myproject |
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,2 +1,3 @@ | ||
es/logs | ||
es/data | ||
.env |
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,23 @@ | ||
.PHONY: clean | ||
clean: ## Cleanup index | ||
rm -fR ./es/data | ||
mkdir ./es/data | ||
|
||
.PHONY: destroy | ||
destroy: ## Destroy all environment including IntelliJ metadata and libraries | ||
docker-compose down --rmi all --volumes --remove-orphans; \ | ||
rm -fR ./es/data | ||
rm -fR .gradle | ||
rm -fR .idea | ||
|
||
.PHONY: run | ||
run: ## Shorthand of running docker images | ||
docker-compose up --build --remove-orphans | ||
|
||
.PHONY: down | ||
down: ## Stop Docker | ||
docker-compose down | ||
|
||
.PHONY: help | ||
help: ## Display this help screen | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' |
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,35 +1,131 @@ | ||
version: "3.8" | ||
services: | ||
setup: | ||
image: docker.elastic.co/elasticsearch/elasticsearch:${STACK_VERSION} | ||
volumes: | ||
- certs:/usr/share/elasticsearch/config/certs | ||
user: "0" | ||
command: > | ||
bash -c ' | ||
if [ x${ELASTIC_PASSWORD} == x ]; then | ||
echo "Set the ELASTIC_PASSWORD environment variable in the .env file"; | ||
exit 1; | ||
elif [ x${KIBANA_PASSWORD} == x ]; then | ||
echo "Set the KIBANA_PASSWORD environment variable in the .env file"; | ||
exit 1; | ||
fi; | ||
if [ ! -f certs/ca.zip ]; then | ||
echo "Creating CA"; | ||
bin/elasticsearch-certutil ca --silent --pem -out config/certs/ca.zip; | ||
unzip config/certs/ca.zip -d config/certs; | ||
fi; | ||
if [ ! -f certs/certs.zip ]; then | ||
echo "Creating certs"; | ||
echo -ne \ | ||
"instances:\n"\ | ||
" - name: elasticsearch\n"\ | ||
" dns:\n"\ | ||
" - elasticsearch\n"\ | ||
" - localhost\n"\ | ||
" ip:\n"\ | ||
" - 127.0.0.1\n"\ | ||
> config/certs/instances.yml; | ||
bin/elasticsearch-certutil cert --silent --pem -out config/certs/certs.zip --in config/certs/instances.yml --ca-cert config/certs/ca/ca.crt --ca-key config/certs/ca/ca.key; | ||
unzip config/certs/certs.zip -d config/certs; | ||
fi; | ||
echo "Setting file permissions" | ||
chown -R root:root config/certs; | ||
find . -type d -exec chmod 750 \{\} \;; | ||
find . -type f -exec chmod 640 \{\} \;; | ||
echo "Waiting for Elasticsearch availability"; | ||
until curl -s --cacert config/certs/ca/ca.crt https://elasticsearch:9200 | grep -q "missing authentication credentials"; do sleep 30; done; | ||
echo "Setting kibana_system password"; | ||
until curl -s -X POST --cacert config/certs/ca/ca.crt -u elastic:${ELASTIC_PASSWORD} -H "Content-Type: application/json" https://elasticsearch:9200/_security/user/kibana_system/_password -d "{\"password\":\"${KIBANA_PASSWORD}\"}" | grep -q "^{}"; do sleep 10; done; | ||
echo "All done!"; | ||
' | ||
healthcheck: | ||
test: ["CMD-SHELL", "[ -f config/certs/elasticsearch/elasticsearch.crt ]"] | ||
interval: 1s | ||
timeout: 5s | ||
retries: 120 | ||
|
||
elasticsearch: | ||
build: es | ||
mem_limit: 4g | ||
depends_on: | ||
setup: | ||
condition: service_healthy | ||
build: | ||
context: ./es | ||
args: | ||
- STACK_VERSION=${STACK_VERSION} | ||
volumes: | ||
- certs:/usr/share/elasticsearch/config/certs | ||
- esdata:/usr/share/elasticsearch/data | ||
ports: | ||
- "9200:9200" | ||
- "9300:9300" | ||
- ${ES_PORT}:9200 | ||
environment: | ||
- node.name=elasticsearch | ||
- cluster.name=${CLUSTER_NAME} | ||
- cluster.initial_master_nodes=elasticsearch | ||
- ELASTIC_PASSWORD=${ELASTIC_PASSWORD} | ||
- bootstrap.memory_lock=true | ||
- xpack.security.enabled=true | ||
- xpack.security.http.ssl.enabled=true | ||
- xpack.security.http.ssl.key=certs/elasticsearch/elasticsearch.key | ||
- xpack.security.http.ssl.certificate=certs/elasticsearch/elasticsearch.crt | ||
- xpack.security.http.ssl.certificate_authorities=certs/ca/ca.crt | ||
- xpack.security.http.ssl.verification_mode=certificate | ||
- xpack.security.transport.ssl.enabled=true | ||
- xpack.security.transport.ssl.key=certs/elasticsearch/elasticsearch.key | ||
- xpack.security.transport.ssl.certificate=certs/elasticsearch/elasticsearch.crt | ||
- xpack.security.transport.ssl.certificate_authorities=certs/ca/ca.crt | ||
- xpack.security.transport.ssl.verification_mode=certificate | ||
- xpack.license.self_generated.type=${LICENSE} | ||
mem_limit: ${MEM_LIMIT} | ||
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=-Xms2g -Xmx2g" | ||
- discovery.type=single-node | ||
- bootstrap.memory_lock=true | ||
- xpack.security.enabled=false | ||
- xpack.graph.enabled=false | ||
- xpack.ml.enabled=false | ||
- xpack.monitoring.enabled=true | ||
- xpack.watcher.enabled=false | ||
healthcheck: | ||
test: | ||
[ | ||
"CMD-SHELL", | ||
"curl -s --cacert config/certs/ca/ca.crt https://localhost:9200 | grep -q 'missing authentication credentials'", | ||
] | ||
interval: 10s | ||
timeout: 10s | ||
retries: 120 | ||
|
||
kibana: | ||
image: docker.elastic.co/kibana/kibana:7.9.3 | ||
depends_on: | ||
elasticsearch: | ||
condition: service_healthy | ||
image: docker.elastic.co/kibana/kibana:${STACK_VERSION} | ||
volumes: | ||
- certs:/usr/share/kibana/config/certs | ||
- kibanadata:/usr/share/kibana/data | ||
ports: | ||
- "5601:5601" | ||
- ${KIBANA_PORT}:5601 | ||
environment: | ||
- xpack.security.enabled=false | ||
- "ELASTICSEARCH_HOSTS=http://elasticsearch:9200" | ||
- SERVERNAME=kibana | ||
- ELASTICSEARCH_HOSTS=https://elasticsearch:9200 | ||
- ELASTICSEARCH_USERNAME=kibana_system | ||
- ELASTICSEARCH_PASSWORD=${KIBANA_PASSWORD} | ||
- ELASTICSEARCH_SSL_CERTIFICATEAUTHORITIES=config/certs/ca/ca.crt | ||
mem_limit: ${MEM_LIMIT} | ||
healthcheck: | ||
test: | ||
[ | ||
"CMD-SHELL", | ||
"curl -s -I http://localhost:5601 | grep -q 'HTTP/1.1 302 Found'", | ||
] | ||
interval: 10s | ||
timeout: 10s | ||
retries: 120 | ||
|
||
volumes: | ||
certs: | ||
driver: local | ||
esdata: | ||
driver: local | ||
kibanadata: | ||
driver: local |
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,8 +1,7 @@ | ||
FROM docker.elastic.co/elasticsearch/elasticsearch:7.9.3 | ||
ARG STACK_VERSION=$STACK_VERSION | ||
FROM docker.elastic.co/elasticsearch/elasticsearch:$STACK_VERSION | ||
|
||
COPY ./elasticsearch-analysis-kuromoji-ipadic-neologd-7.9.3-SNAPSHOT.zip ./ | ||
|
||
RUN elasticsearch-plugin install file:./elasticsearch-analysis-kuromoji-ipadic-neologd-7.9.3-SNAPSHOT.zip | ||
RUN elasticsearch-plugin install analysis-kuromoji | ||
RUN elasticsearch-plugin install analysis-icu | ||
RUN elasticsearch-plugin install analysis-smartcn | ||
RUN elasticsearch-plugin install analysis-stempel |
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,2 +1,5 @@ | ||
東京スカイツリー,東京 スカイツリー,トウキョウ スカイツリー,カスタム名詞 | ||
あいうえお,あいうえお,アイウエオ,カスタム名詞 | ||
あいうえお,あいうえお,アイウエオ,カスタム名詞 | ||
京都府,京都,府,キョウト,フ,カスタム名詞 | ||
東京都,東京,都,トウキョウ,ト,カスタム名詞 | ||
金メダル,金,メダル,キン,メダル,カスタム名詞 |
Binary file removed
BIN
-51.7 MB
es/elasticsearch-analysis-kuromoji-ipadic-neologd-7.9.3-SNAPSHOT.zip
Binary file not shown.
Oops, something went wrong.