ELKStack之消息隊列
阿新 • • 發佈:2017-06-29
修改配置文件 ces key yum 技術分享 data red 生產 install
redis消息隊列
安裝redis
yum -y install redis
修改配置文件
修改ip
後臺運行
啟動
systemctl start redis
查看
lsof -i:6379
連接
redis-cli -h 10.13.85.9
cd /etc/logstash/conf.d/
vim redis.conf
input{ stdin {} } output{ redis{ host => "10.13.85.9" port => "6379" db => "6" data_type => "list" key => "demo" } }
啟動
/opt/logstash/bin/logstash -f redis.conf
另外開一個窗口啟動redis連接
redis-cli -h 10.13.85.9
select 6
驗證可以寫一個收集apache日誌的配置文件
vim apache.conf
input{ file{ path => "/var/log/httpd/access_log" start_position => "beginning" } } output{ redis{ host => "10.13.85.9" port => "6379" db => "6" data_type => "list" key => "apache-accesslog" } }
啟動
/opt/logstash/bin/logstash -f apache.conf
查看最好一行
生產中可以在另外一臺服務器啟動一個logstash收集redis裏面的數據
在另外服務器上面
vim /etc/logstash/conf.d/indexer.conf
input{ redis{ host => "10.13.85.9" port => "6379" db => "6" data_type => "list" key => "demo" } } output{ stdout{ codec => rubydebug } }
啟動如果成功了加filter處理apache
ELKStack之消息隊列