metricbeat6.1.1安装和配置
安装前系统设置
1、防火墙设置
centos7.0默认防火墙为firewalld
#停止firewall
# systemctl stop firewalld.service
#禁止firewall开机启动
# systemctl disable firewalld.service
查看默认防火墙状态:
# firewall-cmd --state
2、修改selinux
# setenforce 0
# vi /etc/selinux/config
将SELINUX=enforcing改为:SELINUX=disabled
一、安装metricbeat
1、下载metricbeat
cd /opt/
scp 10.32.35.100:/data/share/bigdata/elastic/metricbeat-6.1.1-linux-x86_64.tar.gz /opt/
2、解压
tar -xzvf metricbeat-6.1.1-linux-x86_64.tar.gz
mv metricbeat-6.1.1-linux-x86_64 metricbeat
二、配置metricbeat
1、修改metricbeat.yml(所有的配置都在该文件下进行)
vi /opt/metricbeat/metricbeat.yml
#output.elasticsearch:
# Array of hosts to connect to.
# hosts: ["localhost:9200"]
output.logstash:
# The Logstash hosts
hosts: ["10.32.35.134:5044"]
三、配置logstash
1、创建配置文件
mkdir /opt/logstash/myconf
vi /opt/logstash/myconf/filebeat.conf
input {
beats {
port => 5044
}
}
output{
stdout{
codec=>rubydebug
}
}
2、启动logstash
./logstash -f /opt/logstash/myconf/filebeat.conf
四、启动metricbeat
cd /opt/metricbeat
./metricbeat -e -c metricbeat.yml
后台运行
nohup ./metricbeat -e -c metricbeat.yml >/dev/null 2>&1 &
停止进程
ps -ef |grep metricbeat
kill -9 id