大数据全系列 教程
1869个小节阅读:466.8k
目录
408考研
JAVA全系列 教程
面向对象的程序设计语言
Python全系列 教程
Python3.x版本,未来主流的版本
人工智能 教程
顺势而为,AI创新未来
大厂算法 教程
算法,程序员自我提升必经之路
C++ 教程
一门通用计算机编程语言
微服务 教程
目前业界流行的框架组合
web前端全系列 教程
通向WEB技术世界的钥匙
大数据全系列 教程
站在云端操控万千数据
AIGC全能工具班
A A
White Night
具体步骤:
Ctrl+C关闭node3上的flume,并将/opt/flume-1.9.0拷贝到node1的/opt目录下
xxxxxxxxxx
[root@node3 ~]# scp -r /opt/flume-1.9.0/ node1:/opt
node1上配置环境变量,并使之生效
xxxxxxxxxx
[root@node1 ~]# vim /etc/profile
# flume环境变量
export FLUME_HOME=/opt/flume-1.9.0
export PATH=$PATH:$FLUME_HOME/bin
[root@node1 conf]# source /etc/profile
在node1上复制netcat-logger.conf为netcat-avro.conf。
xxxxxxxxxx
[root@node1 jobs]# cp netcat-logger.conf netcat-avro.conf
xxxxxxxxxx
[root@node1 jobs]# vim netcat-avro.conf
a1.sources.r1.bind = node3
# Describe the sink
a1.sinks.k1.type = logger
改为:
xxxxxxxxxx
# 将监听的node3改为node1
a1.sources.r1.bind = node1
# Describe the sink
a1.sinks.k1.type = avro
a1.sinks.k1.hostname = node3
a1.sinks.k1.port = 10086
在node3上复制netcat-logger.conf为avro-logger.conf。
xxxxxxxxxx
[root@node3 jobs]# cp netcat-logger.conf avro-logger.conf
node3上修改配置文件avro-logger.conf
xxxxxxxxxx
# Describe/configure the source
a1.sources.r1.type = netcat
a1.sources.r1.bind = node3
a1.sources.r1.port = 44444
改为:
xxxxxxxxxx
# Describe/configure the source
a1.sources.r1.type = avro
a1.sources.r1.bind = node3
a1.sources.r1.port = 10086
启动node3上的flume(由于node1发送给node3所以先启动node3)
xxxxxxxxxx
[root@node3 jobs]# flume-ng agent -c ./ -n a1 -f avro-logger.conf -Dflume.root.logger=INFO,console
复制一个node3的终端查看端口10086占用情况
xxxxxxxxxx
[root@node3 ~]# ss -nal
启动node1上的flume(由于node1发送给node3所以后启动node1)
xxxxxxxxxx
[root@node1 jobs]# flume-ng agent -c ./ -n a1 -f netcat-avro.conf -Dflume.root.logger=INFO,console
node2上发消息给node1
xxxxxxxxxx
[root@node2 ~]# yum install -y telnet
[root@node2 ~]# telnet node1 44444
Trying 192.168.20.101...
Connected to node1.
Escape character is '^]'.
a
OK
b
OK
c
OK
node1上没有显示信息,而是node3上显示信息,这是因为node1接收到消息后,传递给了node3
xxxxxxxxxx
Event: { headers:{} body: 61 0D a. }
Event: { headers:{} body: 62 0D b. }
Event: { headers:{} body: 63 0D c. }
实时反馈
1. 关于Flume的串联的的描述,错误的是?
A 是将多个flume顺序连接起来。
B 从最初的source开始到最终sink传送的目的存储系统。
C 此模式桥接过多的flume数量,也不会影响传输速率。
D 一旦传输过程中某个节点flume宕机,会影响整个传输系统。
答案:
1.C