下载安装
下载kibana
并解压。
1
2
3
4
5
|
cd /usr/local/src/
wget https://artifacts.elastic.co/downloads/kibana/kibana-7.8.1-linux-x86_64.tar.gz
tar -zxf kibana-7.8.1-linux-x86_64.tar.gz -C /opt
cd /opt
ln -s kibana-7.8.1-linux-x86_64 kibana
|
配置
备份默认配置。
1
2
|
cd /opt/kibana
mv /opt/kibana/config/kibana.yml /opt/kibana/config/kibana.yml.default
|
配置kibana
。
1
2
3
4
5
6
7
8
|
cat /opt/kibana/config/kibana.yml
server.host: "0.0.0.0"
elasticsearch.hosts: ["http://10.0.2.173:9200"]
#elasticsearch.username: "kibana_system"
#elasticsearch.password: "xxxxxxxxxxxxxxx"
elasticsearch.requestTimeout: 400000
elasticsearch.shardTimeout: 400000
|
启动
修改文件权限。
1
2
|
cd /optchown -R ops. kibana
chown -R ops. /opt/kibana-7.8.1-linux-x86_64/
|
配置supervisor
,以ops
用户启动kibana
。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
cat /etc/supervisord.d/kibana.ini
[program:kibana]
command=/opt/kibana/bin/kibana
process_name=%(program_name)s
directory=/opt/kibana/bin/
numprocs=1
startsecs=5
stopsignal=TERM
stopwaitsecs=15
autostart=true
autorestart=true
redirect_stderr=true
user=ops
group=ops
redirect_stderr=true
stdout_logfile_maxbytes=50MB ; max # logfile bytes b4 rotation (default 50MB)
stdout_logfile_backups=10 ; # of stdout logfile backups (default 10)
stdout_logfile=/work/logs/supervisord/kibana.log
stderr_logfile_maxbytes=50MB
stderr_logfile_backups=10
stderr_logfile=/work/logs/supervisord/kibana.log
minfds=65535
minprocs=32700
|
启动kibana
。
1
2
|
supervisorctl update
supervisorctl status kibana
|
kibana
默认监听端口为5601
,配置域名及解析后即可访问。
Nginx配置
nginx
配置可参考:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
upstream kibana {
server 10.22.65.134:5601;
}
server {
listen 80 ;
server_name kibana.snoopyops.top;
index index.html index.htm index.jsp ;
rewrite ^/(.*)$ https://$server_name/$1 ;
}
server {
listen 443 ssl ;
server_name kibana.snoopyops.top;
ssl_certificate /etc/nginx/cert/kibana-snoopyops-top_fullchain.pem;
ssl_certificate_key /etc/nginx/cert/kibana-snoopyops-top_key.pem;
ssl_session_timeout 5m ;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!RC4:!MD5:!aNULL:!eNULL:!NULL:!DH:!EDH:!EXP:+MEDIUM;
ssl_prefer_server_ciphers on;
index index.html index.htm index.jsp;
include iplist/iplist.txt;
access_log /work/nginx/logs/kibana.snoopyops.top.access.log json1;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://kibana;
}
}
|