启动flume的solace source时用户名密码不正确

kmynzznz  于 2021-06-04  发布在  Flume
关注(0)|答案(1)|浏览(683)

我正在尝试使用以下配置为apache flume配置solace源:
jndi.属性

Solace_JMS_VPN=VPN name
Solace_JMS_SSL_TrustStore=<path to trustore file>
Solace_JMS_SSL_TrustStorePassword=truststore password

相关Flume配置

a1.sources.recieveFromJMS.type = jms
a1.sources.recieveFromJMS.channels = c1
a1.sources.recieveFromJMS.initialContextFactory = com.solacesystems.jndi.SolJNDIInitialContextFactory
a1.sources.recieveFromJMS.connectionFactory = connectionFactoryname
a1.sources.recieveFromJMS.providerURL = smfs://username:pass%40word@dns:port
a1.sources.recieveFromJMS.destinationName = queueName
a1.sources.recieveFromJMS.destinationType = QUEUE
a1.sources.recieveFromJMS.batchSize=100

当源代码如下所示启动时,出现异常:

2018-11-13 14:43:36,710 (conf-file-poller-0) [INFO - com.solacesystems.jcsmp.protocol.impl.TcpClientChannel$ClientChannelConnect.call(TcpClientChannel.java:2327)] Connection attempt failed to host 'DNS' ConnectException ((Client name: MyMachine/30512/#00140001   Local addr: IP:port   Remote addr: DNS:port) - )  com.solacesystems.jcsmp.JCSMPErrorResponseException: 401: The username or password is incorrect [Subcode:1] cause: null ((Client name: MyMachine/30512/#00140001   Local addr: DNS:port   Remote addr: DNS:port) - )
2018-11-13 14:43:39,752 (conf-file-poller-0) [INFO - com.solacesystems.jcsmp.protocol.impl.TcpClientChannel.close(TcpClientChannel.java:458)] Channel Closed (smfclient 2)
2018-11-13 14:43:39,783 (conf-file-poller-0) [DEBUG - com.solacesystems.jcsmp.protocol.smf.SimpleSmfClient.close(SimpleSmfClient.java:937)] Local addr: IP:port   Remote addr: DNS:port(smfclient 2) Closing socket
2018-11-13 14:43:39,830 (conf-file-poller-0) [INFO - com.solacesystems.jcsmp.protocol.impl.TcpClientChannel.close(TcpClientChannel.java:458)] Channel Closed (smfclient 2)
2018-11-13 14:43:39,861 (conf-file-poller-0) [DEBUG - com.solacesystems.jcsmp.protocol.smf.SimpleSmfClient.close(SimpleSmfClient.java:937)] Local port: port   Remote addr: DNS:port(smfclient 2) Closing socket
2018-11-13 14:43:39,892 (conf-file-poller-0) [DEBUG - com.solacesystems.jcsmp.impl.flow.SubFlowManagerImpl.close(SubFlowManagerImpl.java:896)] SubFlowManagerImpl closing... close 0 flows
2018-11-13 14:43:39,924 (conf-file-poller-0) [DEBUG - com.solacesystems.jcsmp.impl.JCSMPBasicSession.closeSession(JCSMPBasicSession.java:545)] JCSMPSession[username@tcps://DNS:port] (0001)closed
2018-11-13 14:43:39,970 (conf-file-poller-0) [ERROR - org.apache.flume.node.AbstractConfigurationProvider.loadSources(AbstractConfigurationProvider.java:361)] Source recieveFromJMS has been removed due to an error during configuration
org.apache.flume.FlumeException: Could not lookup ConnectionFactory
        at org.apache.flume.source.jms.JMSSource.doConfigure(JMSSource.java:245)
        at org.apache.flume.source.BasicSourceSemantics.configure(BasicSourceSemantics.java:65)
        at org.apache.flume.source.AbstractPollableSource.configure(AbstractPollableSource.java:63)
        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:97)
        at org.apache.flume.node.PollingPropertiesFileConfigurationProvider$FileWatcherRunnable.run(PollingPropertiesFileConfigurationProvider.java:140)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: javax.naming.NamingException: JNDI lookup failed - 401: The username or password is incorrect

我已经验证了用户名和密码。密码有一个特殊字符(@),我将其替换为%40。还是有同样的错误。谢谢你的帮助和指点。

fjnneemd

fjnneemd1#

我发现了问题。根据给定的优先级,我提供的密码被系统属性(java.naming.security.credentials)覆盖。我在jndi属性文件中提供了用户名 java.naming.security.principal=username 密码作为系统属性 -Djava.naming.security.credentials=password 当启动flume和providerurl时 smfs://dns 一切正常。

相关问题