Kibana部署

  • 服务器
安装软件 主机名 IP地址 系统版本 配置
Kibana Elk 10.3.145.14 centos7.5.1804 2核4G
软件版本:nginx-1.14.2、kibana-7.13.2-linux-x86_64.tar.gz
1. 安装配置Kibana
(1)安装
cpp 复制代码
[root@elk ~]# tar zxf kibana-7.13.2-linux-x86_64.tar.gz -C /usr/local/
(2)配置
cpp 复制代码
[root@elk ~]# echo '
server.port: 5601
server.host: "10.3.145.14"
elasticsearch.hosts: ["http://10.3.145.14:9200"]
kibana.index: ".kibana"
i18n.locale: "zh-CN"
'>>/usr/local/kibana-7.13.2-linux-x86_64/config/kibana.yml

配置项含义:

复制代码
server.port kibana服务端口,默认5601
server.host kibana主机IP地址,默认localhost
elasticsearch.url   用来做查询的ES节点的URL,默认http://localhost:9200
kibana.index        kibana在Elasticsearch中使用索引来存储保存的searches, visualizations和dashboards,默认.kibana
(3)启动
cpp 复制代码
[root@elk ~]# cd /usr/local/kibana-7.13.2-linux-x86_64/
[root@elk ~]# nohup ./bin/kibana &
2. 安装配置Nginx反向代理
(1)配置YUM源:
cpp 复制代码
[root@elk ~]# rpm -ivh <http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm>
(2)安装:
cpp 复制代码
[root@elk ~]# yum install -y nginx httpd-tools 注意:httpd-tools用于生成nginx认证访问的用户密码文件
(3)配置反向代理
cpp 复制代码
[root@elk ~]# cat /etc/nginx/nginx.conf
user  nginx;
worker_processes  4;
error_log  /var/log/nginx/error.log;
pid        /var/run/nginx.pid;
worker_rlimit_nofile 65535;
​
events {
    worker_connections  65535;
    use epoll;
}
​
http {
    include       mime.types;
    default_type  application/octet-stream;
​
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';
​
    access_log  /var/log/nginx/access.log  main;
    server_names_hash_bucket_size 128;
    autoindex on;
​
    sendfile        on;
    tcp_nopush     on;
    tcp_nodelay on;
​
    keepalive_timeout  120;
    fastcgi_connect_timeout 300;
    fastcgi_send_timeout 300;
    fastcgi_read_timeout 300;
    fastcgi_buffer_size 64k;
    fastcgi_buffers 4 64k;
    fastcgi_busy_buffers_size 128k;
    fastcgi_temp_file_write_size 128k;
​
    #gzip模块设置
    gzip on; #开启gzip压缩输出
    gzip_min_length 1k;    #最小压缩文件大小
    gzip_buffers 4 16k;    #压缩缓冲区
    gzip_http_version 1.0;    #压缩版本(默认1.1,前端如果是squid2.5请使用1.0)
    gzip_comp_level 2;    #压缩等级
    gzip_types text/plain application/x-javascript text/css application/xml;    #压缩类型,默认就已经包含textml,所以下面就不用再写了,写上去也不会有问题,但是会有一个warn。
    gzip_vary on;
    #开启限制IP连接数的时候需要使用
    #limit_zone crawler $binary_remote_addr 10m;
    #tips:
    #upstream bakend{#定义负载均衡设备的Ip及设备状态}{
    #    ip_hash;
    #    server 127.0.0.1:9090 down;
    #    server 127.0.0.1:8080 weight=2;
    #    server 127.0.0.1:6060;
    #    server 127.0.0.1:7070 backup;
    #}
    #在需要使用负载均衡的server中增加 proxy_pass http://bakend/;
    server {
        listen       80;
        server_name  172.16.244.28;
​
        #charset koi8-r;
​
       # access_log  /var/log/nginx/host.access.log  main;
        access_log off;
​
         location / {  
             auth_basic "Kibana";   #可以是string或off,任意string表示开启认证,off表示关闭认证。
             auth_basic_user_file /etc/nginx/passwd.db;   #指定存储用户名和密码的认证文件。
             proxy_pass http://172.16.244.28:5601;
             proxy_set_header Host $host:5601;  
             proxy_set_header X-Real-IP $remote_addr;  
             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  
             proxy_set_header Via "nginx";  
                     }
         location /status { 
             stub_status on; #开启网站监控状态 
             access_log /var/log/nginx/kibana_status.log; #监控日志 
             auth_basic "NginxStatus"; } 
​
         location /head/{
             auth_basic "head";
             auth_basic_user_file /etc/nginx/passwd.db;
             proxy_pass http://172.16.244.25:9100/;
             proxy_set_header Host $host:9100;
             proxy_set_header X-Real-IP $remote_addr;
             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
             proxy_set_header Via "nginx";
                         }  
​
        # redirect server error pages to the static page /50x.html
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
}
(4)配置授权用户和密码
cpp 复制代码
[root@elk ~]# htpasswd -cm /etc/nginx/passwd.db kibana
(5)启动nginx
cpp 复制代码
[root@elk ~]# systemctl start nginx

浏览器访问http://10.3.145.14 刚开始没有任何数据,会提示你创建新的索引。

相关推荐
大数据追光猿19 分钟前
【大数据Doris】生产环境,Doris主键模型全表7000万数据更新写入为什么那么慢?
大数据·经验分享·笔记·性能优化·doris
武子康1 小时前
大数据-197 K折交叉验证实战:sklearn 看均值/方差,选更稳的 KNN 超参
大数据·后端·机器学习
数据皮皮侠1 小时前
2m气温数据集(1940-2024)
大数据·数据库·人工智能·制造·微信开放平台
Coder_Boy_3 小时前
基于SpringAI的智能运维平台(AI驱动)
大数据·运维·人工智能
智能化咨询3 小时前
(99页PPT)智慧校园XXX学院总体解决方案(附下载方式)
大数据
wang_yb6 小时前
数据分析师的“水晶球”:时间序列分析
大数据·databook
ModestCoder_6 小时前
Git 版本管理教程
大数据·git·elasticsearch
hg01186 小时前
湖南工程机械海外火爆,非洲成为出口新增长极
大数据
乐迪信息7 小时前
乐迪信息:异物入侵识别算法上线,AI摄像机保障智慧煤矿生产稳定
大数据·运维·人工智能·物联网·安全
熬夜敲代码的小N7 小时前
从SEO到GEO:AI时代内容优化的范式革命
大数据·人工智能·计算机网络