According to the elk system that has been set up before, now add a x-pack plug-in, or who gets the IP and port can access Elasticsearch and Kibana.
The effect is as follows: When you open the Kibana interface, you need to enter your username and password to get in:
First step: Elasticsearch configuration X-pack
Because I use the elasticsearch-6.4.2 version, the entire elk with the 6.4.2 version, in the Elasticesearch-6.4.2/bin directory has come with the X-pack plug-in, do not install. When I look at other information on the Internet, it seems as if the elasticsearch of the previous version of 6.3 have to install x-pack manually.
Words don't say much, keep up the rhythm:
elasticsearch-6.4.2 turn on the security authentication configuration as follows:
The first step:
#打开elasticsearch. yml configuration file:
VI elasticsearch-6.4.2/config/elasticsearch.yml
#加上这条: Set X-pack as Open
Xpack.security.enabled:true
The configuration diagram is as follows:
Step Two:
1. Running Elasticsearch
2. Enable trial license (30-day trial)
" Content-type:application/json " -xpost http://192.168.36.61:9200/_xpack/license/start_trial?acknowledge=true
Step three: Set the password
Run elasticsearch-setup-passwords Setup password #在elasticsearch -6.4.2/bin/directory (default is elastic):
./elasticsearch-setup-passwords Interactive
Set the password result diagram: It will not only set Elasticsearch, the other Kibana, Logstash will also be set together, the password is best set the same
#出现设置密码的结果图如下:
Change Password method:
Curl-h "Content-type:application/json"-xpost-u elastic ' http://192.168.36.61:9200/_xpack/security/user/elastic/_ Password '-d ' {"Password": "123456"} '
Configuration of the Kibana X-pack:
#打开kibana的kibana. yml configuration file:
VI kibana-6.4.2-linux-x86_64/config/kibana.yml
#配置如:
Logstash Configuration X-pack:
#打开自定义的logstash的配置文件logstash. conf, the output data to Elasticsearch when the user name and password are added, such as:
VI logstash-6.4.2/config/logstash.conf
Final Result:
Elasticsearch start, Logstash start, Kibana start. Then open Kibana in the browser, the user login interface appears, such as:
Add a little note: Set the Elk system to start
#借鉴此博客: 73737546
After setting up the Quick Manual Open command:
Service Elasticsearch Start
Service Logstash Start
Service Kibana Start
Elk Log System +x-pack Security verification