设为首页 收藏本站
查看: 1655|回复: 0

[经验分享] 安装flume1.5

[复制链接]
发表于 2015-11-27 19:33:40 | 显示全部楼层 |阅读模式
  1:下载
  wget http://mirrors.hust.edu.cn/apache/flume/1.5.0/apache-flume-1.5.0-bin.tar.gz


  2:解压
  

[jifeng@jifeng02 ~]$ cd apache
[jifeng@jifeng02 apache]$ ls
apache-flume-1.5.0-bin.tar.gz  chukwa-incubating-src-0.5.0.tar.gz
[jifeng@jifeng02 apache]$ tar zxf apache-flume-1.5.0-bin.tar.gz

3:配置环境变量  
  在 .bash_profile最后加上下面三行
  export FLUME_HOME=$HOME/apache/apache-flume-1.5.0-bin

export FLUME_CONF_DIR=$FLUME_HOME/conf

export PATH=$PATH:$FLUME_HOME/bin


  

[jifeng@jifeng02 ~]$ vi .bash_profile
export PATH=$PATH:$ANT_HOME/bin:$HIVE_HOME/bin::$HBASE_HOME/bin:$PIG_HOME/bin:$HADOOP_HOME/bin:$SQOOP_HOME/bin
export FLUME_HOME=$HOME/apache/apache-flume-1.5.0-bin
export FLUME_CONF_DIR=$FLUME_HOME/conf
export PATH=$PATH:$FLUME_HOME/bin
~                                                                                                                       
~                                                                                                                       
~                                                                                                                       
~                                                                                                                       
~                                                                                                                       
~                                                                                                                       
~                                                                                                                       
~                                                                                                                       
".bash_profile" 33L, 1023C 已写入                                                                     
[jifeng@jifeng02 ~]$ source  .bash_profile
[jifeng@jifeng02 ~]$

4:配置flume-env.sh文件  
  复制flume-env.sh.template到 flume-env.sh
  

[jifeng@jifeng02 apache-flume-1.5.0-bin]$ cd conf
[jifeng@jifeng02 conf]$ ls
flume-conf.properties.template  flume-env.sh.template  log4j.properties
[jifeng@jifeng02 conf]$ cp flume-env.sh.template flume-env.sh
[jifeng@jifeng02 conf]$ ls
flume-conf.properties.template  flume-env.sh  flume-env.sh.template  log4j.properties修改JAVA_HOME和JAVA_OPTS  
  

[jifeng@jifeng02 conf]$ vi flume-env.sh
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# If this file is placed at FLUME_CONF_DIR/flume-env.sh, it will be sourced
# during Flume startup.
# Enviroment variables can be set here.
JAVA_HOME=/home/jifeng/jdk1.7.0_45
# Give Flume more memory and pre-allocate, enable remote monitoring via JMX
JAVA_OPTS="-Xms100m -Xmx200m -Dcom.sun.management.jmxremote"
# Note that the Flume conf directory is always included in the classpath.
#FLUME_CLASSPATH=""
~                                                                                                                       
~                                                                                                                       
~                                                                                                                       
~                                                                                                                       
~                                                                                                                       
~                                                                                                                       
~                                                                                                                       
~                                                                                                                       
~                                                                                                                       
~                                                                                                                       
~                                                                                                                       
~                                                                                                                       
~                                                                                                                       
"flume-env.sh" 29L, 1196C 已写入
  5:测试运行
  在conf目录创建example.conf
  

[jifeng@jifeng02 conf]$ vi example.conf内容:  
  

# example.conf: A single-node Flume configuration
# Name the components on this agent
a1.sources = r1
a1.sinks = k1
a1.channels = c1
# Describe/configure the source
a1.sources.r1.type = netcat
a1.sources.r1.bind = localhost
a1.sources.r1.port = 44444
# Describe the sink
a1.sinks.k1.type = logger
# Use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100
# Bind the source and sink to the channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1运行: bin/flume-ng agent --conf ./conf --conf-file ./conf/example.conf --name a1 -Dflume.root.logger=INFO,console  
  

[jifeng@jifeng02 apache-flume-1.5.0-bin]$ bin/flume-ng agent --conf ./conf --conf-file ./conf/example.conf --name a1 -Dflume.root.logger=INFO,console
Info: Sourcing environment configuration script /home/jifeng/apache/apache-flume-1.5.0-bin/conf/flume-env.sh
Info: Including Hadoop libraries found via (/home/jifeng/hadoop/hadoop-1.2.1/bin/hadoop) for HDFS access
Warning: $HADOOP_HOME is deprecated.
Warning: $HADOOP_HOME is deprecated.
Info: Excluding /home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/slf4j-api-1.4.3.jar from classpath
Info: Excluding /home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/slf4j-log4j12-1.4.3.jar from classpath
Info: Including HBASE libraries found via (/home/jifeng/hbase-0.94.21/bin/hbase) for HBASE access
错误: 找不到或无法加载主类 org.apache.flume.tools.GetJavaProperty
Info: Excluding /home/jifeng/hbase-0.94.21/lib/slf4j-api-1.4.3.jar from classpath
Info: Excluding /home/jifeng/hbase-0.94.21/lib/slf4j-log4j12-1.4.3.jar from classpath
Info: Excluding /home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/slf4j-api-1.4.3.jar from classpath
Info: Excluding /home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/slf4j-log4j12-1.4.3.jar from classpath
+ exec /home/jifeng/jdk1.7.0_45/bin/java -Xms100m -Xmx200m -Dcom.sun.management.jmxremote -Dflume.root.logger=INFO,console -cp '/home/jifeng/apache/apache-flume-1.5.0-bin/conf:/home/jifeng/apache/apache-flume-1.5.0-bin/lib/*:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../conf:/home/jifeng/jdk1.7.0_45/lib/tools.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/..:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../hadoop-core-1.2.1.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/asm-3.2.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/aspectjrt-1.6.11.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/aspectjtools-1.6.11.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/commons-beanutils-1.7.0.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/commons-beanutils-core-1.8.0.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/commons-cli-1.2.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/commons-codec-1.4.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/commons-collections-3.2.1.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/commons-configuration-1.6.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/commons-daemon-1.0.1.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/commons-digester-1.8.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/commons-el-1.0.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/commons-httpclient-3.0.1.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/commons-io-2.1.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/commons-lang-2.4.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/commons-logging-1.1.1.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/commons-logging-api-1.0.4.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/commons-math-2.1.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/commons-net-3.1.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/core-3.1.1.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/hadoop-capacity-scheduler-1.2.1.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/hadoop-fairscheduler-1.2.1.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/hadoop-thriftfs-1.2.1.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/hsqldb-1.8.0.10.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/jackson-core-asl-1.8.8.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/jackson-mapper-asl-1.8.8.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/jasper-compiler-5.5.12.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/jasper-runtime-5.5.12.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/jdeb-0.8.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/jersey-core-1.8.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/jersey-json-1.8.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/jersey-server-1.8.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/jets3t-0.6.1.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/jetty-6.1.26.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/jetty-util-6.1.26.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/jsch-0.1.42.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/junit-4.5.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/kfs-0.2.2.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/log4j-1.2.15.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/mockito-all-1.8.5.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/oro-2.0.8.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/servlet-api-2.5-20081211.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/xmlenc-0.52.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/jsp-2.1/jsp-2.1.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/jsp-2.1/jsp-api-2.1.jar:/home/jifeng/hbase-0.94.21/conf:/home/jifeng/jdk1.7.0_45/lib/tools.jar:/home/jifeng/hbase-0.94.21:/home/jifeng/hbase-0.94.21/hbase-0.94.21.jar:/home/jifeng/hbase-0.94.21/hbase-0.94.21-tests.jar:/home/jifeng/hbase-0.94.21/lib/activation-1.1.jar:/home/jifeng/hbase-0.94.21/lib/asm-3.1.jar:/home/jifeng/hbase-0.94.21/lib/avro-1.5.3.jar:/home/jifeng/hbase-0.94.21/lib/avro-ipc-1.5.3.jar:/home/jifeng/hbase-0.94.21/lib/commons-beanutils-1.7.0.jar:/home/jifeng/hbase-0.94.21/lib/commons-beanutils-core-1.8.0.jar:/home/jifeng/hbase-0.94.21/lib/commons-cli-1.2.jar:/home/jifeng/hbase-0.94.21/lib/commons-codec-1.4.jar:/home/jifeng/hbase-0.94.21/lib/commons-collections-3.2.1.jar:/home/jifeng/hbase-0.94.21/lib/commons-configuration-1.6.jar:/home/jifeng/hbase-0.94.21/lib/commons-digester-1.8.jar:/home/jifeng/hbase-0.94.21/lib/commons-el-1.0.jar:/home/jifeng/hbase-0.94.21/lib/commons-httpclient-3.1.jar:/home/jifeng/hbase-0.94.21/lib/commons-io-2.1.jar:/home/jifeng/hbase-0.94.21/lib/commons-lang-2.5.jar:/home/jifeng/hbase-0.94.21/lib/commons-logging-1.1.1.jar:/home/jifeng/hbase-0.94.21/lib/commons-math-2.1.jar:/home/jifeng/hbase-0.94.21/lib/commons-net-1.4.1.jar:/home/jifeng/hbase-0.94.21/lib/core-3.1.1.jar:/home/jifeng/hbase-0.94.21/lib/guava-11.0.2.jar:/home/jifeng/hbase-0.94.21/lib/hadoop-core-1.2.1.jar:/home/jifeng/hbase-0.94.21/lib/hamcrest-core-1.3.jar:/home/jifeng/hbase-0.94.21/lib/high-scale-lib-1.1.1.jar:/home/jifeng/hbase-0.94.21/lib/httpclient-4.1.2.jar:/home/jifeng/hbase-0.94.21/lib/httpcore-4.1.3.jar:/home/jifeng/hbase-0.94.21/lib/jackson-core-asl-1.8.8.jar:/home/jifeng/hbase-0.94.21/lib/jackson-jaxrs-1.8.8.jar:/home/jifeng/hbase-0.94.21/lib/jackson-mapper-asl-1.8.8.jar:/home/jifeng/hbase-0.94.21/lib/jackson-xc-1.8.8.jar:/home/jifeng/hbase-0.94.21/lib/jamon-runtime-2.3.1.jar:/home/jifeng/hbase-0.94.21/lib/jasper-compiler-5.5.23.jar:/home/jifeng/hbase-0.94.21/lib/jasper-runtime-5.5.23.jar:/home/jifeng/hbase-0.94.21/lib/jaxb-api-2.1.jar:/home/jifeng/hbase-0.94.21/lib/jaxb-impl-2.2.3-1.jar:/home/jifeng/hbase-0.94.21/lib/jersey-core-1.8.jar:/home/jifeng/hbase-0.94.21/lib/jersey-json-1.8.jar:/home/jifeng/hbase-0.94.21/lib/jersey-server-1.8.jar:/home/jifeng/hbase-0.94.21/lib/jettison-1.1.jar:/home/jifeng/hbase-0.94.21/lib/jetty-6.1.26.jar:/home/jifeng/hbase-0.94.21/lib/jetty-util-6.1.26.jar:/home/jifeng/hbase-0.94.21/lib/jruby-complete-1.6.5.jar:/home/jifeng/hbase-0.94.21/lib/jsp-2.1-6.1.14.jar:/home/jifeng/hbase-0.94.21/lib/jsp-api-2.1-6.1.14.jar:/home/jifeng/hbase-0.94.21/lib/jsr305-1.3.9.jar:/home/jifeng/hbase-0.94.21/lib/junit-4.11.jar:/home/jifeng/hbase-0.94.21/lib/libthrift-0.8.0.jar:/home/jifeng/hbase-0.94.21/lib/log4j-1.2.16.jar:/home/jifeng/hbase-0.94.21/lib/metrics-core-2.1.2.jar:/home/jifeng/hbase-0.94.21/lib/netty-3.2.4.Final.jar:/home/jifeng/hbase-0.94.21/lib/phoenix-core-3.1.0.jar:/home/jifeng/hbase-0.94.21/lib/protobuf-java-2.4.0a.jar:/home/jifeng/hbase-0.94.21/lib/servlet-api-2.5-6.1.14.jar:/home/jifeng/hbase-0.94.21/lib/snappy-java-1.0.3.2.jar:/home/jifeng/hbase-0.94.21/lib/stax-api-1.0.1.jar:/home/jifeng/hbase-0.94.21/lib/velocity-1.7.jar:/home/jifeng/hbase-0.94.21/lib/xmlenc-0.52.jar:/home/jifeng/hbase-0.94.21/lib/zookeeper-3.4.5.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../conf:/home/jifeng/jdk1.7.0_45/lib/tools.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/..:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../hadoop-core-1.2.1.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/asm-3.2.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/aspectjrt-1.6.11.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/aspectjtools-1.6.11.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/commons-beanutils-1.7.0.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/commons-beanutils-core-1.8.0.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/commons-cli-1.2.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/commons-codec-1.4.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/commons-collections-3.2.1.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/commons-configuration-1.6.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/commons-daemon-1.0.1.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/commons-digester-1.8.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/commons-el-1.0.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/commons-httpclient-3.0.1.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/commons-io-2.1.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/commons-lang-2.4.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/commons-logging-1.1.1.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/commons-logging-api-1.0.4.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/commons-math-2.1.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/commons-net-3.1.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/core-3.1.1.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/hadoop-capacity-scheduler-1.2.1.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/hadoop-fairscheduler-1.2.1.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/hadoop-thriftfs-1.2.1.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/hsqldb-1.8.0.10.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/jackson-core-asl-1.8.8.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/jackson-mapper-asl-1.8.8.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/jasper-compiler-5.5.12.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/jasper-runtime-5.5.12.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/jdeb-0.8.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/jersey-core-1.8.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/jersey-json-1.8.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/jersey-server-1.8.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/jets3t-0.6.1.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/jetty-6.1.26.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/jetty-util-6.1.26.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/jsch-0.1.42.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/junit-4.5.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/kfs-0.2.2.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/log4j-1.2.15.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/mockito-all-1.8.5.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/oro-2.0.8.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/servlet-api-2.5-20081211.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/xmlenc-0.52.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/jsp-2.1/jsp-2.1.jar:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/jsp-2.1/jsp-api-2.1.jar:/home/jifeng/hadoop/hadoop-1.2.1/conf:/home/jifeng/hbase-0.94.21/conf' -Djava.library.path=:/home/jifeng/hadoop/hadoop-1.2.1/libexec/../lib/native/Linux-i386-32 org.apache.flume.node.Application --conf-file ./conf/example.conf --name a1
2014-10-20 11:49:18,703 (lifecycleSupervisor-1-0) [INFO - org.apache.flume.node.PollingPropertiesFileConfigurationProvider.start(PollingPropertiesFileConfigurationProvider.java:61)] Configuration provider starting
2014-10-20 11:49:18,707 (conf-file-poller-0) [INFO - org.apache.flume.node.PollingPropertiesFileConfigurationProvider$FileWatcherRunnable.run(PollingPropertiesFileConfigurationProvider.java:133)] Reloading configuration file:./conf/example.conf
2014-10-20 11:49:18,719 (conf-file-poller-0) [INFO - org.apache.flume.conf.FlumeConfiguration$AgentConfiguration.addProperty(FlumeConfiguration.java:930)] Added sinks: k1 Agent: a1
2014-10-20 11:49:18,719 (conf-file-poller-0) [INFO - org.apache.flume.conf.FlumeConfiguration$AgentConfiguration.addProperty(FlumeConfiguration.java:1016)] Processing:k1
2014-10-20 11:49:18,720 (conf-file-poller-0) [INFO - org.apache.flume.conf.FlumeConfiguration$AgentConfiguration.addProperty(FlumeConfiguration.java:1016)] Processing:k1
2014-10-20 11:49:18,737 (conf-file-poller-0) [INFO - org.apache.flume.conf.FlumeConfiguration.validateConfiguration(FlumeConfiguration.java:140)] Post-validation flume configuration contains configuration for agents: [a1]
2014-10-20 11:49:18,738 (conf-file-poller-0) [INFO - org.apache.flume.node.AbstractConfigurationProvider.loadChannels(AbstractConfigurationProvider.java:150)] Creating channels
2014-10-20 11:49:18,745 (conf-file-poller-0) [INFO - org.apache.flume.channel.DefaultChannelFactory.create(DefaultChannelFactory.java:40)] Creating instance of channel c1 type memory
2014-10-20 11:49:18,752 (conf-file-poller-0) [INFO - org.apache.flume.node.AbstractConfigurationProvider.loadChannels(AbstractConfigurationProvider.java:205)] Created channel c1
2014-10-20 11:49:18,754 (conf-file-poller-0) [INFO - org.apache.flume.source.DefaultSourceFactory.create(DefaultSourceFactory.java:39)] Creating instance of source r1, type netcat
2014-10-20 11:49:18,771 (conf-file-poller-0) [INFO - org.apache.flume.sink.DefaultSinkFactory.create(DefaultSinkFactory.java:40)] Creating instance of sink: k1, type: logger
2014-10-20 11:49:18,778 (conf-file-poller-0) [INFO - org.apache.flume.node.AbstractConfigurationProvider.getConfiguration(AbstractConfigurationProvider.java:119)] Channel c1 connected to [r1, k1]
2014-10-20 11:49:18,787 (conf-file-poller-0) [INFO - org.apache.flume.node.Application.startAllComponents(Application.java:138)] Starting new configuration:{ sourceRunners:{r1=EventDrivenSourceRunner: { source:org.apache.flume.source.NetcatSource{name:r1,state:IDLE} }} sinkRunners:{k1=SinkRunner: { policy:org.apache.flume.sink.DefaultSinkProcessor@1b8202e counterGroup:{ name:null counters:{} } }} channels:{c1=org.apache.flume.channel.MemoryChannel{name: c1}} }
2014-10-20 11:49:18,798 (conf-file-poller-0) [INFO - org.apache.flume.node.Application.startAllComponents(Application.java:145)] Starting Channel c1
2014-10-20 11:49:18,801 (lifecycleSupervisor-1-0) [INFO - org.apache.flume.instrumentation.MonitoredCounterGroup.register(MonitoredCounterGroup.java:119)] Monitored counter group for type: CHANNEL, name: c1: Successfully registered new MBean.
2014-10-20 11:49:18,801 (lifecycleSupervisor-1-0) [INFO - org.apache.flume.instrumentation.MonitoredCounterGroup.start(MonitoredCounterGroup.java:95)] Component type: CHANNEL, name: c1 started
2014-10-20 11:49:18,804 (conf-file-poller-0) [INFO - org.apache.flume.node.Application.startAllComponents(Application.java:173)] Starting Sink k1
2014-10-20 11:49:18,808 (conf-file-poller-0) [INFO - org.apache.flume.node.Application.startAllComponents(Application.java:184)] Starting Source r1
2014-10-20 11:49:18,809 (lifecycleSupervisor-1-2) [INFO - org.apache.flume.source.NetcatSource.start(NetcatSource.java:150)] Source starting
2014-10-20 11:49:18,814 (lifecycleSupervisor-1-2) [INFO - org.apache.flume.source.NetcatSource.start(NetcatSource.java:164)] Created serverSocket:sun.nio.ch.ServerSocketChannelImpl[/127.0.0.1:44444]

再打开一个终端,输入命令:telnet  localhost 44444,输入“hello world”:

[jifeng@jifeng02 ~]$ telnet  localhost 44444
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
hello world
OK
  在原来的终端上查看
  64)] Created serverSocket:sun.nio.ch.ServerSocketChannelImpl[/127.0.0.1:44444]
2014-10-20 14:18:37,599 (SinkRunner-PollingRunner-DefaultSinkProcessor) [INFO - org.apache.flume.sink.LoggerSink.process(LoggerSink.java:70)] Event: { headers:{} body: 68 65 6C 6C 6F 20 77 6F 72 6C 64 0D             hello world. }


这样就成功部署和配置了flume的agent.




  
  

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-144341-1-1.html 上篇帖子: flume 安装 下篇帖子: FLume NG 开发环境
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表