elk之kibana

環境:html

centos7nginx

jdk8centos

 參考:elasticsearch

https://www.elastic.co/guide/en/elasticsearch/reference/current/rpm.html
http://blog.csdn.net/wh211212/article/details/54015645ide

 

1. 將Elasticsearch公共GPG密鑰導入rpmui

rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch

2.在/etc/yum.repos.d/目錄中建立一個名爲kibana.repo的文件url

[root@guo elk]# touch /etc/yum.repos.d/kibana.repo
[root@guo elk]# cat >>touch /etc/yum.repos.d/kibana.repo<<!
> [kibana-5.x]
> name=Kibana repository for 5.x packages
> baseurl=https://artifacts.elastic.co/packages/5.x/yum
> gpgcheck=1
> gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
> enabled=1
> autorefresh=1
> type=rpm-md
> !

 

3.kibana源建立完成以後,經過makecache查看源是否可用,而後經過yum安裝kibanacentos7

yum makecache
yum install kibana -y

4.配置 kibanaspa

Kibana默認從/etc/kibana/kibana.yml文件加載其配置。 
參考:https://www.elastic.co/guide/en/kibana/current/settings.html.net

打開註釋並修改成本身的域名

vi /etc/kibana/kibana.yml 

 

 

5.啓動kibana

systemctl start kibana.service

 

 

6.安裝 nginx

http://www.cnblogs.com/yun965861480/p/7278794.html

7.使用htpasswd建立一個名爲「kibanaadmin」的管理員用戶(能夠使用其餘名稱),該用戶能夠訪問Kibana Web界面:

htpasswd -c /etc/nginx/htpasswd.users kibanaadmin

8.關閉 SELinux

setsebool -P httpd_can_network_connect 1

 

9.配置 nginx

 在/etc/nginx/conf.d 建立 kibana.conf

touch /etc/nginx/conf.d/kibana.conf
vi /etc/nginx/conf.d/kibana.conf
upstream kibana_server{
                server guo:5601;
        }

server {
    listen       80;
    server_name  guo;
    access_log  /var/log/nginx/kibana.aniu.co.access.log main;
    error_log   /var/log/nginx/kibana.aniu.co.access.log;
    auth_basic "Restricted Access";
    auth_basic_user_file /etc/nginx/htpasswd.users;
    location / {
        proxy_pass http://guo:5601;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;        
    }
}

10.重啓nginx,訪問

systemctl restart nginx.service

http://192.168.158.128/

ok

相關文章
相關標籤/搜索