EFK部署centos7.9(三)Kibana部署

EFK部署centos7.9(一)ES单节点部署_争取不加班!的博客-CSDN博客

EFK部署centos7.9(四)Filebeat 部署_争取不加班!的博客-CSDN博客

系统类型:Centos7.9

节点IP: 192.168.11.140

软件版本:nginx-1.14.2、kibana-6.5.4-linux-x86_64.tar.gz

上传或者下载安装包

Wget https://artifacts.elastic.co/downloads/kibana/kibana-6.5.4-linux-x86_64.tar.gz

tar zvxf kibana-6.5.4-linux-x86_64.tar.gz -C /usr/local/

cd /usr/local/kibana-6.5.4-linux-x86_64/config/

vim kibana.yml     添加或者删除注释都行

server.port: 5601

server.host: "192.168.11.140"     #kibana本机的地址

elasticsearch.url: "http://192.168.11.139:9200" #ES主节点地址+端口

kibana.index: ".kibana"

server.port kibana 服务端口,默认5601

server.host kibana 主机IP地址,默认localhost

elasticsearch.url  用来做查询的ES节点的URL,默认http://localhost:9200

kibana.index       kibana在Elasticsearch中使用索引来存储保存的searches, visualizations和dashboards,默认.kibana

cd kibana-6.5.4-linux-x86_64

nohup ./bin/kibana &   启动kibana

安装配置Nginx反向代理

 配置yum源      rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

yum install -y nginx

cd /etc/nginx/conf.d/

cp default.conf nginx.conf

vim nginx.conf

dG   配置文件全删了

然后复制以下配置即可

server {

        listen       80;

        server_name  192.168.11.140;

        #charset koi8-r;

       # access_log  /var/log/nginx/host.access.log  main;

       # access_log off;

         location / {

             proxy_pass http://192.168.11.140: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/{

             proxy_pass http://192.168.11.140: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";

                         }

}

然后配置nginx日志的json格式

vim /etc/nginx/nginx.conf

log_format  json '{"@timestamp":"$time_iso8601",'

                           '"@version":"1",'

                           '"client":"$remote_addr",'

                           '"url":"$uri",'

                           '"status":"$status",'

                           '"domain":"$host",'

                           '"host":"$server_addr",'

                           '"size":$body_bytes_sent,'

                           '"responsetime":$request_time,'

                           '"referer": "$http_referer",'

                           '"ua": "$http_user_agent"'

               '}';

access_log  /var/log/nginx/access_json.log  json;

systemctl start nginx  启动nginx

访问192.168.11.140  本机ip或者192.168.11.140:5601

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值