Skip to content
This repository was archived by the owner on Dec 14, 2022. It is now read-only.

Commit 50e52e3

Browse files
author
Chris Wiechmann
committed
Also Kibana requires special format for ES-Hosts
1 parent 5b30d35 commit 50e52e3

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

env-sample

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ API_MANAGER_PASSWORD=changeme
112112
################################################################################################
113113
# Configure Multi-Node ES-Cluster
114114
################################################################################################
115-
The following parameters are used by the elaticsearch/docker-compose.es<N>.yml files and only
116-
required if you are running Elasticsearch based on Docker-Compose.
117-
If you using an external Elasticsearch cluster, these parameters are not used.
115+
# The following parameters are used by the elaticsearch/docker-compose.es<N>.yml files and only
116+
# required if you are running Elasticsearch based on Docker-Compose.
117+
# If you using an external Elasticsearch cluster, these parameters are not used.
118118
ELASTICSEARCH_HOST1=elasticsearch1
119119
ELASTICSEARCH_HOST2=elasticsearch2
120120
ELASTICSEARCH_HOST3=elasticsearch3

kibana/docker-compose.kibana.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ services:
33
# This is optional, but good to have to perform manual queries and create custom dashboards
44
kibana:
55
image: docker.elastic.co/kibana/kibana:${ELASTIC_VERSION}
6+
# This custom entrypoint is required to adjust the variable ELASTICSEARCH_HOSTS from Comma to Space separated
7+
entrypoint: /usr/share/kibana/scripts/custom-entrypoint.sh
68
container_name: kibana
79
environment:
810
- SERVER_NAME=axway-apim-kibana
@@ -22,6 +24,7 @@ services:
2224
target: /var/log
2325
- ${PWD}/kibana/config/kibana.yml:/usr/share/kibana/config/kibana.yml
2426
- ${PWD}/certificates:/usr/share/kibana/config/certificates
27+
- ${PWD}/kibana/scripts:/usr/share/kibana/scripts
2528
ulimits:
2629
memlock:
2730
soft: -1
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash -e
2+
3+
# This scripts adjusts the configured list of Elasticsearch hosts
4+
# Kibana requires each host to be double quoted
5+
6+
hostsForKibana=`echo ${ELASTICSEARCH_HOSTS} | awk '{split($0, va, /,/); vl=""; for (v in va) { if (vl =="" ) vl = sprintf("\"%s\"", va[v]); else vl = vl sprintf(",\"%s\"", va[v]); } print(vl) }'`
7+
8+
echo "Adjusted given Elasticsearch hosts: ${hostsForKibana} for Kibana"
9+
10+
export ELASTICSEARCH_HOSTS=[$hostsForKibana]
11+
12+
# Finally call the original Docker-Entrypoint
13+
#/usr/local/bin/dumb-init "--"
14+
/usr/local/bin/kibana-docker

0 commit comments

Comments
 (0)