码迷,mamicode.com
首页 > 其他好文 > 详细

ELKStack之消息队列

时间:2017-06-29 00:46:37      阅读:219      评论:0      收藏:0      [点我收藏+]

标签:消息   tac   elkstack   debug   deb   stash   lte   position   start   

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之消息队列

标签:消息   tac   elkstack   debug   deb   stash   lte   position   start   

原文地址:http://www.cnblogs.com/minseo/p/7092164.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!