参考:https://www.elastic.co/guide/en/elastic-stack/current/installing-elastic-stack.html
环境
系统环境
[root@git01 ~]# java -versionopenjdk version "1.8.0_201"OpenJDK Runtime Environment (build 1.8.0_201-b09)OpenJDK 64-Bit Server VM (build 25.201-b09, mixed mode)[root@git01 ~]# uname -r3.10.0-957.el7.x86_64[root@git01 ~]# cat /etc/redhat-releaseCentOS Linux release 7.6.1810 (Core)[root@git01 ~]#
ELK版本 6.7
安装
elasticsearch安装
导入Key
Download and install the public signing key:
rpm —import https://artifacts.elastic.co/GPG-KEY-elasticsearch
rpm —import https://artifacts.elastic.co/GPG-KEY-elasticsearch
设置源
[root@git01 ~]# vim /etc/yum.repos.d/elasticsearch.repo[elasticsearch-6.x]name=Elasticsearch repository for 6.x packagesbaseurl=https://artifacts.elastic.co/packages/6.x/yumgpgcheck=1gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearchenabled=1autorefresh=1type=rpm-md
安装
yum install elasticsearch -y
安装logstash
带入key
和上面一样
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
配置软件源
[root@git01 ~]# vim /etc/yum.repos.d/logstash.repo[logstash-6.x]name=Elastic repository for 6.x packagesbaseurl=https://artifacts.elastic.co/packages/6.x/yumgpgcheck=1gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearchenabled=1autorefresh=1type=rpm-md
yum install logstash -y
[kibana-6.x]
name=Kibana repository for 6.x packages
baseurl=https://artifacts.elastic.co/packages/6.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
[root@git01 ~]# yum install kibana -y
f2ef0fcc60bfee2e4d71a482b80eac24898c8837a7fe61ec2ea53448660b13f704156fca5e81749f88e72ef95d4ce4786dd0d994f05b13729d49083d05183aeb kibana-6.7.1-x86_64.rpm
使用Cobbler创建ELKStack仓库
当然生产环境,肯定不能使用外网的YUM仓库,可以使用Cobbler来创建自己的yum仓库。
[root@log-node1 ~]# cobbler repo add —name=logstash-2.3 —mirror=http://packages.elastic.co/logstash/2.3/centos —arch=x86_64 —breed=yum
[root@log-node1 ~]# cobbler repo add —name=elasticsearch2 —mirror=http://packages.elastic.co/elasticsearch/2.x/centos —arch=x86_64 —breed=yum
[root@log-node1 ~]# cobbler repo add —name=kibana4.5 —mirror=http://packages.elastic.co/kibana/4.5/centos —arch=x86_64 —breed=yum
[root@log-node1 ~]# cobbler reposync
