Flume安裝及簡單部署
環境:
1.flume-ng-1.6.0-cdh5.7.0.tar.gz
2.jdk 1.8
1.下載安裝包並解壓
wget
tar -xvf flume-ng-1.6.0-cdh5.7.0.tar.gz
rm flume-ng-1.6.0-cdh5.7.0.tar.gz
mv apache-flume-1.6.0-cdh5.7.0-bin flume
2.配置環境變數
vi /etc/profile
export FLUME_HOME=/opt/software/flume
exportPATH=.:$FLUME_HOME/bin:$KAFKA_HOME/bin::$ZOOKEEPER_HOME/bin:$PATH
source /etc/profile
3. 配置flume-env.sh檔案
cd /opt/software/flume/conf/
cp flume-env.sh.template flume-env.sh
vi flume-env.sh
export HADOOP_HOME=/opt/software/hadoop
export JAVA_HOME=/usr/java/jdk1.8.0_45
4.版本驗證
flume-ng version
5.Flume部署示例
cd /opt/software/flume/bin/
vi netcat.conf
# 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 that 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
6.執行FlumeAgent,監聽本機的44444埠
flume-ng agent -c conf -f netcat.conf -n a1 -Dflume.root.logger=INFO,console
[root@hadoop001 bin]# flume-ng agent -c conf -f netcat.conf -n a1 -Dflume.root.logger=INFO,console
Info: Including Hadoop libraries found via (/opt/software/hadoop-2.6.0-cdh5.7.0/bin/hadoop) for HDFS access
Info: Excluding /opt/software/hadoop-2.6.0-cdh5.7.0/share/hadoop/common/lib/slf4j-api-1.7.5.jar from classpath
Info: Excluding /opt/software/hadoop-2.6.0-cdh5.7.0/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar from classpath
Info: Including Hive libraries found via (/opt/software/hive-1.1.0-cdh5.7.0) for Hive access
.......
18/03/25 17:52:39 INFO instrumentation.MonitoredCounterGroup: Component type: CHANNEL, name: c1 started
18/03/25 17:52:39 INFO node.Application: Starting Sink k1
18/03/25 17:52:39 INFO node.Application: Starting Source r1
18/03/25 17:52:39 INFO source.NetcatSource: Source starting
18/03/25 17:52:40 INFO source.NetcatSource: Created serverSocket:sun.nio.ch.ServerSocketChannelImpl[/127.0.0.1:44444]
7.開啟另外一個client
telnet localhost 44444
[root@hadoop001 ~]# telnet localhost 44444
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
111
OK18/03/25 18:11:15 WARN source.NetcatSource: Client sent event exceeding the maximum length
18/03/25 18:12:50 INFO sink.LoggerSink: Event: { headers:{} body: 31 31 31 0D 111. }
8.完畢
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31496956/viewspace-2152209/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Flume1.7.0下載及安裝部署
- flume的安裝部署
- 新版flume+kafka+storm安裝部署KafkaORM
- Chaosblade簡介及安裝部署
- Redash視覺化BI系統部署安裝及簡單使用視覺化
- sysbench安裝及簡單使用
- 三十七、Flume的安裝及測試
- WebSphere(was8.5)安裝簡單應用程式部署安裝Web
- Linux環境Flume安裝配置及使用Linux
- RocketMQ安裝及部署MQ
- Flume篇---Flume安裝配置與相關使用
- 簡要分析ZooKeeper基本原理及安裝部署
- kafka環境安裝及簡單使用(單機版)Kafka
- Ubuntu下docker安裝及簡單應用UbuntuDocker
- nginx部署及簡單優化Nginx優化
- K8s(Kubernetes)簡介及安裝部署K8S
- Docker-ElasticSearch7.8.1 安裝及簡單介紹DockerElasticsearch
- jenkins簡單安裝及配置(Windows環境JenkinsWindows
- BBED的安裝及簡單的使用方法
- Flume NG 簡介及配置實戰
- Ansible的安裝及部署
- Apache安裝部署及工作模式Apache模式
- Linux flume安裝與配置Linux
- mysql 簡單安裝MySql
- Redis 4.0.2單機安裝部署Redis
- Kafka應用實戰——Kafka安裝及簡單使用Kafka
- logstash5.x安裝及簡單運用H5
- monogdb windows環境下 安裝及使用簡單示例MonoWindows
- Qmail系統的安裝、簡單配置及使用(轉)AI
- PostgreSQL簡介及安裝SQL
- RabbitMQ簡介及安裝MQ
- Django簡介及安裝Django
- Allure簡介及安裝
- Docker簡介及安裝Docker
- 01 . SaltStack部署配置及簡單應用
- webpack(簡單安裝配置)Web
- CentOS簡單操作命令及node.js的安裝方法CentOSNode.js
- 2.Python及Pycharm的安裝與簡單配置PythonPyCharm