Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

How to install elasticsearch and kibana 8.x using Docker?

Prerequisite

The following requirements and recommendations apply when running Elasticsearch in Docker in production.

The following requirements and recommendations apply when running Elasticsearch in Docker in production.

Set vm.max_map_count to at least 262144

The vm.max_map_count kernel setting must be set to at least 262144 for production use.

How you set vm.max_map_count depends on your platform.

To view the current value for the vm.max_map_count setting, run:

$ grep vm.max_map_count /etc/sysctl.conf
$ vm.max_map_count=262144

To apply the setting on a live system, run:
$ sysctl -w vm.max_map_count=262144

To permanently change the value for the vm.max_map_count setting, update the value in /etc/sysctl.conf.


Step 1 – Install Docker

Step 2 – Run Elasticsearch on Docker for development

$ docker network create elastic
$ docker pull docker.elastic.co/elasticsearch/elasticsearch:8.3.3
$ docker run --name es-node01 --net elastic -p 9200:9200 -p 9300:9300 -t docker.elastic.co/elasticsearch/elasticsearch:8.3.3
$ docker logs es-node01

When you start Elasticsearch for the first time, the following security configuration occurs automatically:

  • Certificates and keys are generated for the transport and HTTP layers.
  • The Transport Layer Security (TLS) configuration settings are written to elasticsearch.yml.
  • A password is generated for the elastic user.
  • An enrollment token is generated for Kibana.

Copy the generated password and enrollment token and save them in a secure location. These values are shown only when you start Elasticsearch for the first time. You’ll use these to enroll Kibana with your Elasticsearch cluster and log in.

Step 3 – Run Kibana on Docker for development


In a new terminal session, start Kibana and connect it to your Elasticsearch container:


$ docker pull docker.elastic.co/kibana/kibana:8.3.3
$ docker run --name kib-01 --net elastic -p 5601:5601 docker.elastic.co/kibana/kibana:8.3.3
$ docker logs kib-01

example  http://192.168.1.16:5601/?code=036004

When you start Kibana, a unique link is output to your terminal.

To access Kibana, click the generated link in your terminal.

In your browser, paste the enrollment token that you copied when starting Elasticsearch and click the button to connect your Kibana instance with Elasticsearch.

Log in to Kibana as the elastic user with the password that was generated when you started Elasticsearch.

Default user name & password

  • elastic / check the output of docker run

Verification for the ownership

Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments

Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.

0
Would love your thoughts, please comment.x
()
x