Elasticsearch & Kibana environment installation (CentOS)

created at 07-07-2021 views: 21

Here we demonstrate by way of Docker installation under CentOS

1 Installation of Elasticsearch

1.1 Pull the image

docker pull docker.elastic.co/elasticsearch/elasticsearch:7.6.2

Pull the mirror

1.2 Start the container

docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.6.2

note: discovery.type=single-node is set to specify that the node is a single node discovery in order to bypass the ES boot check

start successfully

1.3 check the container id

docker ps

container id

At this step, ES has been successfully started, and can be checked by visiting server IP:9200. We can find that the container id and name are the same

visit elasticsearch

Next we make some changes

1.4 Enter the container

docker exec -it {container id} bash

1.5 Modify the configuration file

vi config/elasticsearch.yml

Press i to enter the edit mode, modify the cluster name and node name

cluster.name: my-application
node.name: node-1
  • save with Esc+:wq
  • Ctrl+D exit the current container

1.6 Restart the container

docker restart {container Id}

Visit again server IP:9200 The configuration has taken effect

2 Installation of Kibana

The steps are basically the same as ES

2.1 Pull the mirror

docker pull kibana:7.6.2

2.2 Start the container

docker run --name kibana -p 5601:5601 -d kibana:7.6.2

2.3 View container id

docker ps

2.4 Access

Browser Server IP:5601, if error Kibana server is not ready yet appears, it means that Kibana did not find the ES node

To handle this situation, we need to modify the configuration of Kibana. See below.

3.deal Kibana error

to deal with the problem of Kibana server is not ready yet

3.1 enter container

docker exec -it {container id} bash

3.2 Edit Kibana configuration file

vi config/kibana.yml

3.3 elasticsearch.hosts

Modify the elasticsearch.hostsin the configuration file and change it to the ip address of your own server, as shown in the figure

modify hosts

Esc + :wq to save
Ctrl+D exit the current container

3.4 Restart container

docker restart {container Id}

3.5 access again

server IP:5601

access 5601 port

created at:07-07-2021
edited at: 07-08-2021: