Elasticsearch + Docker Compose: Use Keystore - Demonstration

Published on 2023-12-21

« Back to all documents Contact Us
Elasticsearch + Docker Compose: Use Keystore - Demonstration

Introduction

Code on Github: Elasticsearch + Docker-Compose Keystore

We will setup Elasticsearch, Kibana, beats, and Logstash with Docker Compose.

This video assumes you already have a setup of Elaticesearch, Kibana, Beats, and Logstash without using a Container. If not then you can go here setup. And you should understand Elastic Agent, Fleet Server and APM TBD.

Requirements

Step 1 - Demonstration [02:55]

Build with the below docker compose command.

docker-compose up --build -d

Get the IP address of your server for it will be used as the url to the docker containers.

hostname -i

Visit Kibana page with http://<YOUR IP ADDRESS>:5601. Then login with the elastic username and password present at the .env file

username: elastic password: changeme

alt text Kibana Login page

Go to Fleet > Settings. Run the ./get-cert-details.sh to determine your CA finger print and your CA. Populate the information as shown in this screenshot:

alt text Fleet Server changes

then click on Save and apply settings, and then proceed to click on Save and deploy. Now go back to the Fleet > Agent and refresh the tab. You should see something similar to the image below, which indicates that Elastic Agent, AM and Fleet Server are up abd running.

alt text Elastic Agent, APM, and Fleet Server Running Success

Step 2 - Confirm services are operational [07:28]

APM

To view the APM services go to Observability > APM > Services, and you should see something similar to the image below

alt text APM Success

Metricbeat

Go to Observability > Overview, and scroll down to the host section. You should see a similar result as below to confirm that metricbeats container is publishing result to Kibana.

alt text Metricbeat Success

Filebeat

Go to Observability > Discover, and click on create data view. You should fill in the details as shown in the image below:

alt text Create Filebeat Data View

And click save. You will see something similar to the below image, which confirms that filebeat works successfully:

alt text Filebeat Success

Logstash

Click on create data view. You should fill in the details as shown in the image below:

alt text Create Logstash Data View

Confirm Services Remain Operational [14:33]

Got to your server terminal and run the below command to change the filebeat log file:

vi filebeat_ingest_data/test.log

and write in the text as shown in the image below, into the file:

alt text Make changes to the log in test.log file for Filebeat

Do the same for Logstash with;

vi logstash_ingest_data/test.log

and write in the text as shown in the image below, into the file:

alt text Make changes to the log in test.log file for Logstash

Go to Stack Management and confirm that all services are up and running.

alt text All Services in Stack Management

If you need any assistance, email us through our Contact Form.