E.L.K·1·安装

高斋晓开卷,独共圣人语。这篇文章主要讲述E.L.K·1·安装相关的知识,希望能为你提供帮助。
参考文档:
https://www.linuxtechi.com/install-elk-stack-elasticsearch-logstash-kibana-centos7-rhel7/


模拟环境:CentOS7(192.168.1.97)


一、准备工作:
1.准备java环境
# yum install java-1.8.0-openjdk
# java -version
2.设置the Hostname and update /etc/hosts file
# hostnamectl set-hostname "elk-stack.example.com"
# vi /etc/hosts
192.168.1.97   elk-stack.example.com elk-stack
3.安装GPG keys 
# rpm –import https://packages.elastic.co/GPG-KEY-elasticsearch


二、安装ELK步骤


·安装Elasticsearch
1.创建 elastic-search repository
# vi /etc/yum.repos.d/elasticsearch.repo
添加文档内容:
[elasticsearch]
name=Elasticsearch repository
baseurl=http://packages.elastic.co/elasticsearch/2.x/centos
gpgcheck=1
gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch
enabled=1


2.安装elasticsearch
# yum install elasticsearch -y


3.开启服务设置开机运行
# systemctl daemon-reload
# systemctl start elasticsearch
# systemctl enable elasticsearch


4.防火墙开放访问端口
# firewall-cmd --permanent --add-port 9200/tcp


5.验证:
# curl -X GET http://localhost:9200


·安装Logstash
1.创建logstash repository,
# vi /etc/yum.repos.d/logstash.repo
添加文档内容:
[logstash]
name=Logstash
baseurl=http://packages.elasticsearch.org/logstash/2.2/centos
gpgcheck=1
gpgkey=http://packages.elasticsearch.org/GPG-KEY-elasticsearch
enabled=1
Now install logstash,
2.安装Logstash
# yum install logstash -y


·安装Kibana
1.创建kibana repository:
# vi /etc/yum.repos.d/kibana.repo
添加文档内容:
[kibana-4.5]
name=Kibana repository for 4.5.x packages
baseurl=http://packages.elastic.co/kibana/4.5/centos
gpgcheck=1
gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch
enabled=1


2.安装kibana
# yum install kibana -y


3.开启服务设置开机运行
# systemctl start kibana
# systemctl enable kibana


4.防火墙开放访问端口
# firewall-cmd --permanent --add-port 5601/tcp
# firewall-cmd —reload


5.验证
【E.L.K·1·安装】http://192.168.1.97:5601/   // http://IP-Address:5601/

    推荐阅读