日志收集系统Flume的简单安装Centos7
来源:互联网 发布:皓月屠龙翅膀升级数据 编辑:程序博客网 时间:2024/06/05 06:01
先设置java home
JAVA_HOME=/opt/java
PATH=$PATH:$JAVA_HOME/bin
export JAVA_HOME PATH
从下载最新的版本:http://flume.apache.org/download.html
tar zxvf apache-flume-1.*.0-bin.tar.gz
cd flume
cp conf/flume-conf.properties.template conf/flume-conf.properties
先用telnet来测试日志收集:
vi conf/flume-conf.properties
# The configuration file needs to define the sources,
# the channels and the sinks.
# Sources, channels and sinks are defined per agent,
# in this case called 'agent'
agent.sources = r1
agent.channels = c1
agent.sinks = s1
# For each one of the sources, the type is defined
agent.sources.r1.type = netcat
agent.sources.r1.bind = localhost
agent.sources.r1.port = 8888
#如果收集本地的,则:
agent.sources.r1.type = exec
agent.sources.r1.command = tail -F /etc/httpd/logs/access_log
agent.sources.r1.batchSize=20
# The channel can be defined as follows.
agent.sources.r1.channels = c1
# Each sink's type must be defined
agent.sinks.s1.type = file_roll
agent.sinks.s1.sink.directory = /tmp/log/flume
#如果是kafka
agent.sinks.s1.type=org.apache.flume.sink.kafka.KafkaSink
#设置Kafka的broker地址和端口号
agent.sinks.s1.brokerList=192.168.6.202:9092
#设置Kafka的Topic
agent.sinks.s1.topic=test
#设置序列化方式
agent.sinks.s1.serializer.class=kafka.serializer.StringEncoder
#Specify the channel the sink should use
agent.sinks.s1.channel = c1
# Each channel's type is defined.
agent.channels.c1.type = memory
# Other config values specific to each type of channel(sink or source)
# can be defined as well
# In this case, it specifies the capacity of the memory channel
agent.channels.c1.capacity = 100
配置好后:
mkdir -p /tmp/log/flume
bin/flume-ng agent --conf conf -f conf/flume-conf.properties -n agent&
telnet localhost 8888
输入
hello world!
hello Flume!
在/tmp/log/flume里就能看到刚才的内容了
- 日志收集系统Flume的简单安装Centos7
- flume日志收集系统
- 分布式日志收集系统:Flume
- FLUME日志收集系统搭建
- flume日志收集系统搭建
- flume (日志收集系统)
- 分布式日志收集收集系统:Flume(转)
- Flume分布式日志收集收集系统
- 分布式日志收集收集系统:Flume
- 分布式日志收集收集系统:Flume
- 日志系统之Flume日志收集
- 日志系统之Flume日志收集
- 分布式日志收集系统Apache Flume的设计介绍
- 分布式日志收集系统Apache Flume的设计介绍
- 分布式日志收集系统Apache Flume的设计介绍
- 分布式日志收集系统Apache Flume的设计介绍
- 分布式日志收集系统Apache Flume的设计详细介绍
- 分布式日志收集系统Apache Flume的设计详细介绍
- tableview的source绑定、select跳转绑定
- jsp中jstl标签的类似 if
- mvn 请使用 -source 7 或更高版本以启用 diamond 运算符
- Eratosthenes筛法
- 12单元练习
- 日志收集系统Flume的简单安装Centos7
- 关于导入SVN的项目到Android studio中路径包含中文报错处理
- 屏蔽词、模糊检索实现—字典树的应用
- input text onchange
- get请求参数为中文是乱码的问题
- Linux学习篇之~unit10练习
- 名企笔试:去哪儿2015研发笔试题(寻找Coder)2017-03-24 算法爱好者
- ROS入门记录 [4]
- HDU 4421 Bit Magic(2-SAT)