我正在尝试设置一个flume代理,它使用jms作为源,hdfs作为接收器。
我遵循的步骤是
1) 创建了一个.binding文件
git clone https://github.com/ibm-messaging/mq-docker.git
docker volume create qm1data
docker run
--env LICENSE=accept
--env MQ_QMGR_NAME=QM1
--publish 1414:1414
--publish 9443:9443
--volume mqvol:/tmp/mq --detach mq
转到/opt/mqm/java/bin/jmsadmin->
DEFINE QCF(confact) QMGR(QM1) tran(client) chan(DEV.ADMIN.SVRCONN) host(10.2.201.80) port(1414)
DEFINE Q(DEV.QUEUE.1) QUEUE(DEV.QUEUE.1) QMGR(QM1)
end
2) 使用以下有用的链接将相关的jar和.binding文件放在适当的位置:how to use.binding file for jms to hdfs
3) 仅启动flume代理以获取以下错误消息
org.apache.flume.FlumeException: Could not lookup ConnectionFactory
at org.apache.flume.source.jms.JMSSource.doConfigure(JMSSource.java:233)
at org.apache.flume.source.BasicSourceSemantics.configure(BasicSourceSemantics.java:65)
at org.apache.flume.source.AbstractPollableSource.configure(AbstractPollableSource.java:65)
at org.apache.flume.conf.Configurables.configure(Configurables.java:41)
at org.apache.flume.node.AbstractConfigurationProvider.loadSources(AbstractConfigurationProvider.java:326)
at org.apache.flume.node.AbstractConfigurationProvider.getConfiguration(AbstractConfigurationProvider.java:101)
at org.apache.flume.node.PollingPropertiesFileConfigurationProvider$FileWatcherRunnable.run(PollingPropertiesFileConfigurationProvider.java:141)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.naming.NameNotFoundException: confact
at com.sun.jndi.fscontext.RefFSContext.getObjectFromBindings(RefFSContext.java:400)
at com.sun.jndi.fscontext.RefFSContext.lookupObject(RefFSContext.java:327)
at com.sun.jndi.fscontext.RefFSContext.lookup(RefFSContext.java:146)
at com.sun.jndi.fscontext.FSContext.lookup(FSContext.java:127)
at javax.naming.InitialContext.lookup(InitialContext.java:411)
at org.apache.flume.source.jms.JMSSource.doConfigure(JMSSource.java:231)
哪里 confact
是我创建的工厂。
绑定文件类似于
cat /var/lib/flume-ng/plugins.d/ibmmqjms/jndi/.binding|head -10
# This file is used by the JNDI FSContext.
# Sun Feb 18 13:41:26 UTC 2018
confact/RefAddr/30/Encoding=String
confact/RefAddr/19/Content=unspecified
confact/RefAddr/26/Content=1
confact/RefAddr/33/Content=0
confact/RefAddr/70/Content=443
confact/RefAddr/15/Content=false
confact/RefAddr/22/Content=1
confact/RefAddr/102/Type=XMSC_CONNECTION_TYPE
我怀疑jndi绑定没有发生是因为某种原因。感谢您的帮助。
谢谢…玛纳斯
1条答案
按热度按时间6ovsh4lw1#
问题是应该调用绑定文件名
.bindings
而不是.binding