Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

refactor files to support stack deployment of elasticsearch logtash a… #108

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
TAG=6.6.0
ELASTIC_VERSION=6.6.0
TAG=7.6.1
ELASTIC_VERSION=7.6.1
1 change: 1 addition & 0 deletions config/elasticsearch/elasticsearch.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cluster.name: "docker-cluster"
network.host: 0.0.0.0
transport.host: 0.0.0.0
node.name: elasticsearch

# minimum_master_nodes need to be explicitly set when bound on a public IP
# set to 1 to allow single node clusters
Expand Down
7 changes: 4 additions & 3 deletions config/kibana/kibana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

server.name: kibana
server.host: "0"
elasticsearch.url: https://elasticsearch:9200
elasticsearch.hosts: ["https://elasticsearch:9200"]

# elasticsearch.password is stored in `kibana.keystore`
elasticsearch.username: kibana
elasticsearch.ssl.certificateAuthorities: ["/usr/share/kibana/config/certs/ca/ca.crt"]
server.ssl.enabled: false
#server.ssl.certificate: /usr/share/kibana/config/certs/kibana/kibana.crt
#server.ssl.key: /usr/share/kibana/config/certs/kibana/kibana.key
server.ssl.certificate: /usr/share/kibana/config/certs/kibana/kibana.crt
server.ssl.key: /usr/share/kibana/config/certs/kibana/kibana.key
xpack.monitoring.ui.container.elasticsearch.enabled: true
4 changes: 2 additions & 2 deletions config/logstash/logstash.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
http.host: 0.0.0.0
# read password from logstash.keystore
xpack.monitoring.elasticsearch.password: ${ELASTIC_PASSWORD}
xpack.monitoring.elasticsearch.url: https://elasticsearch:9200
xpack.monitoring.elasticsearch.hosts: ["https://elasticsearch:9200"]
xpack.monitoring.elasticsearch.username: logstash_system
xpack.monitoring.elasticsearch.ssl.ca: /usr/share/logstash/config/certs/ca/ca.crt
xpack.monitoring.elasticsearch.ssl.certificate_authority: /usr/share/logstash/config/certs/ca/ca.crt

2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:${TAG}
container_name: elasticsearch
environment:
- cluster.initial_master_nodes=elasticsearch
secrets:
- source: ca.crt
target: /usr/share/elasticsearch/config/certs/ca/ca.crt
Expand Down
6 changes: 5 additions & 1 deletion scripts/setup-elasticsearch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ fi

# Determine if x-pack is enabled
echo "Determining if x-pack is installed..."
if [[ -d /usr/share/elasticsearch/bin/x-pack ]]; then
if [[ -f /usr/share/elasticsearch/bin/x-pack-env ]]; then
if [[ -n "$ELASTIC_PASSWORD" ]]; then

echo "=== CREATE Keystore ==="
Expand Down Expand Up @@ -37,6 +37,10 @@ if [[ -d /usr/share/elasticsearch/bin/x-pack ]]; then
echo "CA directory exists, removing..."
rm -rf /config/ssl/ca
fi
echo "Install unzip if needed..."
if ! command -v unzip &>/dev/null; then
yum -qy install unzip
fi
echo "Unzip ca files..."
unzip /config/ssl/docker-cluster-ca.zip -d /config/ssl

Expand Down
2 changes: 1 addition & 1 deletion scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ docker-compose -f docker-compose.yml -f docker-compose.setup.yml up setup_elasti
# setup kibana and logstash (and system passwords)
docker-compose -f docker-compose.yml -f docker-compose.setup.yml up setup_kibana setup_logstash
# setup beats and apm server
docker-compose -f docker-compose.yml -f docker-compose.setup.yml up setup_auditbeat setup_filebeat setup_heartbeat setup_metricbeat setup_packetbeat setup_apm_server
#docker-compose -f docker-compose.yml -f docker-compose.setup.yml up setup_auditbeat setup_filebeat setup_heartbeat setup_metricbeat setup_packetbeat setup_apm_server

printf "Setup completed successfully. To start the stack please run:\n\t docker-compose up -d\n"
printf "\nIf you wish to remove the setup containers please run:\n\tdocker-compose -f docker-compose.yml -f docker-compose.setup.yml down --remove-orphans\n"
Expand Down