参考:https://www.elastic.co/guide/en/elastic-stack/current/installing-elastic-stack.html

环境

系统环境

  1. [root@git01 ~]# java -version
  2. openjdk version "1.8.0_201"
  3. OpenJDK Runtime Environment (build 1.8.0_201-b09)
  4. OpenJDK 64-Bit Server VM (build 25.201-b09, mixed mode)
  5. [root@git01 ~]# uname -r
  6. 3.10.0-957.el7.x86_64
  7. [root@git01 ~]# cat /etc/redhat-release
  8. CentOS Linux release 7.6.1810 (Core)
  9. [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

设置源

  1. [root@git01 ~]# vim /etc/yum.repos.d/elasticsearch.repo
  2. [elasticsearch-6.x]
  3. name=Elasticsearch repository for 6.x packages
  4. baseurl=https://artifacts.elastic.co/packages/6.x/yum
  5. gpgcheck=1
  6. gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
  7. enabled=1
  8. autorefresh=1
  9. type=rpm-md

安装

yum install elasticsearch -y

安装logstash

169M

带入key

和上面一样

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

配置软件源

  1. [root@git01 ~]# vim /etc/yum.repos.d/logstash.repo
  2. [logstash-6.x]
  3. name=Elastic repository for 6.x packages
  4. baseurl=https://artifacts.elastic.co/packages/6.x/yum
  5. gpgcheck=1
  6. gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
  7. enabled=1
  8. autorefresh=1
  9. type=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