1.安装依赖
1)挂载:mount /dev/cdrom /mnt/
2)解压程序包: tar zxvf /mnt/node-v8.2.1.tar.gz -C /usr/src
3)剪切:mv /usr/src/node-v8.2.1/ /usr/local/node
4)切换目录:cd /usr/local/node
5)编译安装:./configure && make && make install
2.配置ELK
1)安装 :rpm -ivh /mnt/elasticsearch-5.5.0.rpm
2)修改配置文件:vim /etc/elasticsearch/elasticsearch.ym
3)启动服务:systemctl daemon-reload
systemctl start elasticsearch.service
4)监听端口:netstat -anptu | grep 9200
5)修改host文件: vim /etc/hosts
3.安装图形化管理elasticsearch-head
1)解压程序包:tar zxvf /mnt/node-v8.2.1.tar.gz -C /usr/src
2)解压程序包:tar jxvf /mnt/phantomjs-2.1.1-linux-x86_64.tar.bz2 -C/usr/src
3)切换目录:cd /usr/src/phantomjs-2.1.1-linux-x86_64/,cd bin/
4)复制: cp phantomjs /usr/local/bin/
5)添加权限:chmod +x /usr/local/bin/phantomjs
6)解压程序包:tar zxvf /mnt/elasticsearch-head.tar.gz -C /usr/src
7)剪切: mv /usr/src/elasticsearch-head/ /usr/local/
8)进入安装目录:cd /usr/local/elasticsearch-head/
9)安装:npm install
10)修改elasticsearch跨域访问 : vim /etc/elasticsearch/elasticsearch.yml
11)重新启动服务: /etc/init.d/elasticsearch restart
12)修改elasticsearch-head配置文件监听9200:vim /usr/local/elasticsearch-head/_site/app.js
13)修改修改elasticsearch-head配置文件监听9100端口: vim /usr/local/elasticsearch-head/Gruntfile.js
14)启动服务:
15)监听端口:netstat -anptu | grep 9100
16)访问
4.安装配置logstash
1)安装: rpm -ivh logstash-5.5.1.rpm
2)优化命令:ln -s /usr/share/logstash/bin/logstash /usr/local/bin/
3)启动服务systemctl start logstash
五.采集apache成功日志
1)设置允许日志读取: chmod o+r /var/log/httpd/access_log
2)创建采集日志文件 touch /etc/logstash/conf.d/apache.conf
3)重新启动logstash: systemctl restart logstash.service
5.安装配置kibana
1)安装 : rpm -ivh /mnt/kibana-5.5.1-x86_64.rpm
2)修改主配置文件 :vim /etc/kibana/kibana.yml
3)启动服务:systemctl start kibana
4)访问