解決,ELK 中老版本中,需要訪問的用戶名及密碼方可以問9200及5601
1、環境准備
服務器操作系統 | 服務器名 | IP | 安裝內容 |
centos7.9 | elk-master | 192.168.1.101 | elasticsearch master /nginx/ kibana 可視化工具 |
2、安裝elasticsearch /nginx/kibana 略
3、修改配置文件
nginx的配置文件修改
server {
listen 9200;
server_name localhost;
location / {
proxy_pass http://192.168.1.100:10000;
auth_basic "plase input user and passwd";
auth_basic_user_file /etc/nginx/passwd.db;
index index.html index.htm;
}
}
server {
listen 5601;
# listen [::]:80;
server_name _;
root /usr/share/nginx/html;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
error_page 404 /404.html;
location = /404.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
location / {
proxy_pass http://192.168.1.100:10001;
auth_basic "plase input user and passwd";
auth_basic_user_file /etc/nginx/passwd.db;
root html;
index index.html index.htm;
}
}
保存后,加載一下配置文件
./nginx -s reload
注:具體配置文件根據實際安裝情況,YUM安裝的ELK和編譯安裝的位置不同
修改elk中相關默認端口
vim elasticsearch.yml
http.port: 10000
# vim kibana.yml
server.port: 10001
elasticsearch.url: "http://192.168.1.100:10000"
4、加密你的密碼
#openssl passwd -crypt 123456
qHADluTMKUshk
5、生成密碼文件
touch /etc/nginx/passwd.db
admin:qHADluTMKUshk
6、測試(略)
謝謝大家!