Logstash连接到JBoss队列导致;AMQ119031无法验证用户“;
我正在尝试使用logstash连接到JBoss EAP 7.1上的远程队列。我已经创建了一个应用程序用户,并使用Logstash连接到JBoss队列导致;AMQ119031无法验证用户“;,jboss,jms,logstash,activemq-artemis,Jboss,Jms,Logstash,Activemq Artemis,我正在尝试使用logstash连接到JBoss EAP 7.1上的远程队列。我已经创建了一个应用程序用户,并使用add user.sh为他提供了guest角色,但每当我尝试连接到队列时,就会出现AMQ119031无法验证用户的错误,我的设置来自logstash.conf: input { jms { # Logstash Configuration Settings. include_header => false include_
add user.sh
为他提供了guest
角色,但每当我尝试连接到队列时,就会出现AMQ119031无法验证用户的错误,我的设置来自logstash.conf
:
input {
jms {
# Logstash Configuration Settings.
include_header => false
include_properties => false
include_body => true
use_jms_timestamp => false
destination => "AuditTrailMDB"
pub_sub => false
# JNDI Settings
jndi_name => 'jms/RemoteConnectionFactory'
jndi_context => {
'java.naming.factory.initial' => org.wildfly.naming.client.WildFlyInitialContextFactory
'java.naming.security.principal' => 'admin'
'java.naming.provider.url' => 'http-remoting://127.0.0.1:8080'
'java.naming.security.credentials' => 'admin'
}
# Jar files to be imported
require_jars=> ['/home/Alternant/logstash/dependencies/wildfly-client-all-7.1.0.GA-redhat-11.jar']
}
}
output {
stdout{}
}
standalone.xml
:
至于日志呢
[main] JMS Consumer Died {:exception=>"Java::JavaxJms::JMSSecurityException", :exception_message=>"AMQ119031: Unable to validate user", :backtrace=>["org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.sendBlocking(org/apache/activemq/artemis/core/protocol/core/impl/ChannelImpl.java:404)", "org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.sendBlocking(org/apache/activemq/artemis/core/protocol/core/impl/ChannelImpl.java:315)", "org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQClientProtocolManager.createSessionContext(org/apache/activemq/artemis/core/protocol/core/impl/ActiveMQClientProtocolManager.java:288)", "org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQClientProtocolManager.createSessionContext(org/apache/activemq/artemis/core/protocol/core/impl/ActiveMQClientProtocolManager.java:237)", "org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl.createSessionChannel(org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java:1284)", "org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl.createSessionInternal(org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java:670)", "org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl.createSession(org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java:295)", "org.apache.activemq.artemis.jms.client.ActiveMQConnection.authorize(org/apache/activemq/artemis/jms/client/ActiveMQConnection.java:671)", "org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnectionInternal(org/apache/activemq/artemis/jms/client/ActiveMQConnectionFactory.java:791)", "org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnection(org/apache/activemq/artemis/jms/client/ActiveMQConnectionFactory.java:265)", "org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnection(org/apache/activemq/artemis/jms/client/ActiveMQConnectionFactory.java:260)", "java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:498)", "org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:440)"
JBoss日志:
12:09:17,956 ERROR [org.apache.activemq.artemis.core.server] (default I/O-3) AMQ224018: Failed to create session: ActiveMQSecurityException[errorType=SECURITY_EXCEPTION message=AMQ119031: Unable to validate user]
at org.apache.activemq.artemis.core.security.impl.SecurityStoreImpl.authenticate(SecurityStoreImpl.java:144)
at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.createSession(ActiveMQServerImpl.java:1283)
at org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQPacketHandler.handleCreateSession(ActiveMQPacketHandler.java:158)
at org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQPacketHandler.handlePacket(ActiveMQPacketHandler.java:81)
at org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.handlePacket(ChannelImpl.java:633)
at org.apache.activemq.artemis.core.protocol.core.impl.RemotingConnectionImpl.doBufferReceived(RemotingConnectionImpl.java:379)
at org.apache.activemq.artemis.core.protocol.core.impl.RemotingConnectionImpl.bufferReceived(RemotingConnectionImpl.java:362)
at org.apache.activemq.artemis.core.remoting.server.impl.RemotingServiceImpl$DelegatingBufferHandler.bufferReceived(RemotingServiceImpl.java:621)
at org.apache.activemq.artemis.core.remoting.impl.netty.ActiveMQChannelHandler.channelRead(ActiveMQChannelHandler.java:69)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926)
at org.xnio.netty.transport.AbstractXnioSocketChannel$ReadListener.handleEvent(AbstractXnioSocketChannel.java:443)
at org.xnio.netty.transport.AbstractXnioSocketChannel$ReadListener.handleEvent(AbstractXnioSocketChannel.java:379)
at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66)
at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:89)
at org.xnio.nio.WorkerThread.run(WorkerThread.java:591)
您没有传递JMS的任何凭据。您正在为JNDI查找传递凭据,但请记住,JNDI和JMS彼此100%独立,因此它们有自己的凭据。您应该在logstash.conf
中的jms
块中设置username
和password
,如中所述:
要清楚,这个示例配置只是一个示例。您应该调整它,以便为您的环境使用正确的凭据。哦,是的,很抱歉,我将修复itOk,但是在jndi连接的配置中,他们没有提到用户名和密码属性?哦,对于那些不能正常工作的记录,jms中是否有默认用户,或者我应该创建一个,以及如何创建?作为偶尔编写文档的人,我可以很容易地说,仅仅因为文档中的示例没有它,并不意味着您不需要它。服务器上是否记录了身份验证失败?如果是这样,当您更改为使用JMS凭据的Logstash配置时,日志消息是否发生了更改?在你的问题中,你已经说过你创建了一个应用程序用户,对吗?如果这是正确的,那么您应该使用这些凭据。服务器上是否记录了身份验证失败?是的,当您更改为Logstash配置以使用JMS凭据时,日志消息是否更改?不,我正在为jms和JNDIO使用这些凭据。当身份验证失败时,服务器上记录了什么消息?好的,我将用JBoss记录的异常更新这个问题
jms {
# Logstash Configuration Settings.
include_header => false
include_properties => false
include_body => true
use_jms_timestamp => false
destination => "AuditTrailMDB"
pub_sub => false
# JMS provider credentials
username => "admin"
password => "admin"
# JNDI Settings
jndi_name => 'jms/RemoteConnectionFactory'
jndi_context => {
'java.naming.factory.initial' => org.wildfly.naming.client.WildFlyInitialContextFactory
'java.naming.security.principal' => 'admin'
'java.naming.provider.url' => 'http-remoting://127.0.0.1:8080'
'java.naming.security.credentials' => 'admin'
}
# Jar files to be imported
require_jars=> ['/home/Alternant/logstash/dependencies/wildfly-client-all-7.1.0.GA-redhat-11.jar']
}