赞
踩
[root@master flume-1.9.0]# bin/flume-ng version
错误: 找不到或无法加载主类 org.apache.flume.tools.GetJavaProperty
错误: 找不到或无法加载主类 org.apache.flume.tools.GetJavaProperty
错误: 找不到或无法加载主类 org.apache.flume.tools.VersionInfo
解决:
环境变量配错了
检查一下 /etc/profile
1、SLFJ:slf4j-log4j12-1.7.10.jar冲突
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/soft/flume-1.9.0/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/soft/hadoop-2.7.6/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/soft/hbase-1.4.6/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
解决:改名或者删除
[root@master lib]# mv /usr/local/soft/flume-1.9.0/lib/slf4j-log4j12-1.7.25.jar /usr/local/soft/flume-1.9.0/lib/slf4j-log4j12-1.7.25.jar.bak
[root@master lib]# mv /usr/local/soft/hbase-1.4.6/lib/slf4j-log4j12-1.7.10.jar /usr/local/soft/hbase-1.4.6/lib/slf4j-log4j12-1.7.10.jar.bak
2、log4j缺失
log4j:WARN No appenders could be found for logger (org.apache.flume.lifecycle.LifecycleSupervisor).
解决:
检查一下启动命令
[root@master flume-1.9.0]# bin/flume-ng agent -n a1 -c conf -f job/net-flume-logger.conf -Dflume.root.logger=INFO,console
我是因为 INFO console之间用了.(不是,)才出现这个问题(好弱智。。。)
要在安装的flume目录下启动
-c conf (这个conf就是安装的flume下的conf目录)
Ncat: Connection refused.
解决nc/netcat:无法找到命令的问题
[root@node1 ~]# nc localhost 44444
Ncat: Connection refused.
[root@node1 ~]# netcat
bash: netcat: 未找到命令...
[root@node1 ~]# whereis nc
nc: /usr/bin/nc /usr/share/man/man1/nc.1.gz
说明默认的nc链接到了ncat,并没有安装到netcat
1、yum install -y epel-release
2、sudo yum install -y netcat
3、输入netcat 出现:说明安装成功
[root@master netcat-0.7.1]# netcat
usage: nc [-46cDdFhklNnrStUuvz] [-C certfile] [-e name] [-H hash] [-I length]
[-i interval] [-K keyfile] [-M ttl] [-m minttl] [-O length]
[-o staplefile] [-P proxy_username] [-p source_port] [-R CAfile]
[-s sourceaddr] [-T keyword] [-V rtable] [-W recvlimit] [-w timeout]
[-X proxy_protocol] [-x proxy_address[:port]] [-Z peercertfile]
[destination] [port]
4、whereis netcat
netcat: /usr/bin/netcat /usr/share/man/man1/netcat.1.gz
5、cd /usr/bin/
6、mv netcat nc
开了个终端node1(节点master监听)来通信,输入nc localhost 44444 或者nc master 44444 或者 nc master的ip地址 44444 都没反应。。。就算连上了传的数据也对不上、、
然后我重开了一个master终端。。输入nc localhost 44444就可以了
------------------------------------------------2023.6.28更新-------------------------------------------------------------
这个跟配置文件conf中的source有关,下面这个是我的配置
a1.sources.r1.type = netcat
a1.sources.r1.bind = master (这里设置了master)
a1.sources.r1.port = 44444
我在master节点启动了这个flume,然后不管在哪个节点master、node1或者node2,输入下面这个命令都可以进行传数据
nc master 44444
然后我又把source的bind改成localhost
a1.sources.r1.type = netcat
a1.sources.r1.bind = localhost (这里绑定地址为localhost)
a1.sources.r1.port = 44444
还是在master节点启动了这个flume任务,这个时候只能在master节点进行传数据,就是重新开一个终端,输入
nc localhost 44444
在node1,node2都会出现没反应的情况
end...
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。