kibana画图

 

 

画图和面板

[root@localhost ~]# yum install -y java-1.8.0-openjdk.x86_64 
[root@localhost ~]# java -version
openjdk version "1.8.0_252"
[root@localhost ~]# rpm -ivh elasticsearch-6.6.0.rpm

[root@localhost ~]#  egrep -v "^#" /etc/elasticsearch/elasticsearch.yml
node.name: node-1
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
bootstrap.memory_lock: true
network.host: 0.0.0.0
http.port: 9200
[root@localhost ~]# vim /etc/elasticsearch/jvm.options 

[root@localhost ~]#  systemctl edit elasticsearch
[root@localhost ~]# systemctl daemon-reload
[root@localhost ~]# systemctl restart elasticsearch
[root@localhost ~]# systemctl enable  elasticsearch

##########################################
[root@localhost ~]#  rpm -ivh kibana-6.6.0-x86_64.rpm
[root@localhost ~]# grep "^[a-z]" /etc/kibana/kibana.yml
server.port: 5601
server.host: "0.0.0.0"
elasticsearch.hosts: ["http://localhost:9200"]
kibana.index: ".kibana"
[root@localhost ~]# systemctl start kibana
[root@localhost ~]# systemctl enable kibana
[root@localhost ~]# systemctl status kibana
[root@localhost ~]# netstat -lntup|grep 5601
tcp        0      0 0.0.0.0:5601            0.0.0.0:*               LISTEN  

##########################################
[root@localhost ~]# vim /etc/yum.repos.d/nginx.repo
[root@localhost ~]# yum -y install nginx
[root@localhost ~]# cd /etc/nginx/
[root@localhost nginx]# ls
conf.d  fastcgi_params  koi-utf  koi-win  mime.types  modules  nginx.conf  scgi_params  uwsgi_params  win-utf
[root@localhost nginx]# cp nginx.conf nginx.conf.bak
[root@localhost nginx]# vim nginx.conf
[root@localhost nginx]# cat nginx.conf
user  nginx;
worker_processes  1;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       /etc/nginx/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"';

    log_format json  '{ "time_local": "$time_local", '
                          '"remote_addr": "$remote_addr", '
                          '"referer": "$http_referer", '
                          '"request": "$request", '
                          '"status": $status, '
                          '"bytes": $body_bytes_sent, '
                          '"agent": "$http_user_agent", '
                          '"x_forwarded": "$http_x_forwarded_for", '
                          '"up_addr": "$upstream_addr",'
                          '"up_host": "$upstream_http_host",'
                          '"upstream_time": "$upstream_response_time",'
                          '"request_time": "$request_time"'
' }';

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

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    include /etc/nginx/conf.d/*.conf;
}
[root@localhost nginx]# 


##########################################

[root@localhost ~]# rpm -ivh filebeat-6.6.0-x86_64.rpm
[root@localhost ~]# cd /etc/filebeat/
[root@localhost filebeat]# ls
fields.yml  filebeat.reference.yml  filebeat.yml  modules.d
[root@localhost filebeat]# cp filebeat.yml filebeat.yml.bak
[root@localhost filebeat]# vim filebeat.yml
[root@localhost filebeat]# vi filebeat.yml
[root@localhost filebeat]# cat filebeat.yml
filebeat.inputs:
- type: log
  enabled: true 
  paths:
    - /var/log/nginx/access.log
  json.keys_under_root: true
  json.overwrite_keys: true
  tags: ["access"] 

- type: log
  enabled: true 
  paths:
    - /var/log/nginx/error.log
  tags: ["error"]

setup.kibana:
  host: "192.168.1.22:5601"

output.elasticsearch:
  hosts: ["192.168.1.22:9200"]
  #index: "nginx-%{[beat.version]}-%{+yyyy.MM}"
  indices:
    - index: "nginx-access-%{[beat.version]}-%{+yyyy.MM}"
      when.contains:
        tags: "access"
    - index: "nginx-error-%{[beat.version]}-%{+yyyy.MM}"
      when.contains:
        tags: "error"

setup.template.name: "nginx"
setup.template.pattern: "nginx-*"
setup.template.enabled: false
setup.template.overwrite: true
[root@localhost filebeat]# 

[root@localhost filebeat]# systemctl start filebeat
[root@localhost filebeat]# netstat -anptu | grep filebeat
访问:http://192.168.1.22/
[root@localhost filebeat]# netstat -anptu | grep filebeat
tcp        0      0 192.168.1.22:43228      192.168.1.22:9200       ESTABLISHED 18701/filebeat
EFK环境部署

 

 

 

 

 

 

 

 

画区域图

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 画饼状图

 

 

 

 

 

 

 

 

 

 

画数据统计图

 

 

 

 

 

面板汇集多个图

 

 

 

 

 

posted @ 2020-05-05 17:57  冥想心灵  阅读(26)  评论(0编辑  收藏  举报