Activemq端口放行(activemq报错Transport Connection to: tcp://XXX failed: java.io.EOFExcepti)
发现有的activemq部署后局域网内其他机子连接日志报错为
2021-08-06 16:21:49,499 | WARN | Transport Connection to: tcp://172.20.13.10:61287 failed: java.io.EOFException | org.apache.activemq.broker.TransportConnection.Transport | ActiveMQ Transport: tcp:///172.20.13.10:61287@61616 2021-08-06 16:21:50,339 | INFO | Stopping tcp://172.20.13.10:61284 because Failed with SecurityException: Broker: localhost - Client: haikan already connected from tcp://172.20.13.10:61275 | org.apache.activemq.broker.TransportConnection | ActiveMQ BrokerService[localhost] Task-3881 2021-08-06 16:21:50,681 | WARN | Failed to add Connection id=ID:liuxuesheng-rl-53331-637638621782443041-1:1248, clientId=haikan due to {} | org.apache.activemq.broker.TransportConnection | ActiveMQ Transport: tcp:///172.20.13.10:61289@61616 javax.jms.InvalidClientIDException: Broker: localhost - Client: haikan already connected from tcp://172.20.13.10:61275 at org.apache.activemq.broker.region.RegionBroker.addConnection(RegionBroker.java:247)[activemq-broker-5.15.10.jar:5.15.10] at org.apache.activemq.broker.jmx.ManagedRegionBroker.addConnection(ManagedRegionBroker.java:227)[activemq-broker-5.15.10.jar:5.15.10] at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:99)[activemq-broker-5.15.10.jar:5.15.10] at org.apache.activemq.advisory.AdvisoryBroker.addConnection(AdvisoryBroker.java:119)[activemq-broker-5.15.10.jar:5.15.10] at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:99)[activemq-broker-5.15.10.jar:5.15.10] at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:99)[activemq-broker-5.15.10.jar:5.15.10] at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:99)[activemq-broker-5.15.10.jar:5.15.10] at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:99)[activemq-broker-5.15.10.jar:5.15.10] at org.apache.activemq.security.JaasAuthenticationBroker.addConnection(JaasAuthenticationBroker.java:71)[activemq-broker-5.15.10.jar:5.15.10] at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:99)[activemq-broker-5.15.10.jar:5.15.10] at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:99)[activemq-broker-5.15.10.jar:5.15.10] at org.apache.activemq.broker.TransportConnection.processAddConnection(TransportConnection.java:849)[activemq-broker-5.15.10.jar:5.15.10] at org.apache.activemq.broker.jmx.ManagedTransportConnection.processAddConnection(ManagedTransportConnection.java:77)[activemq-broker-5.15.10.jar:5.15.10] at org.apache.activemq.command.ConnectionInfo.visit(ConnectionInfo.java:139)[activemq-client-5.15.10.jar:5.15.10] at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:336)[activemq-broker-5.15.10.jar:5.15.10] at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:200)[activemq-broker-5.15.10.jar:5.15.10] at org.apache.activemq.transport.MutexTransport.onCommand(MutexTransport.java:50)[activemq-client-5.15.10.jar:5.15.10] at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:125)[activemq-client-5.15.10.jar:5.15.10] at org.apache.activemq.transport.AbstractInactivityMonitor.onCommand(AbstractInactivityMonitor.java:301)[activemq-client-5.15.10.jar:5.15.10] at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83)[activemq-client-5.15.10.jar:5.15.10] at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:233)[activemq-client-5.15.10.jar:5.15.10] at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:215)[activemq-client-5.15.10.jar:5.15.10] at java.lang.Thread.run(Thread.java:748)[:1.8.0_202]
客户端不报错但是无法从mq获取消息
大华设备调试的坑:不要从config页直接获取mq的日志,基本上是不全的,得进mq目录导出
百度上查找到方法为:(来源:CSDN)
问题描述:producer插入MQ的时候出现,客户端插入消息失败,提示服务器无命令应答返回的情况,让用户检查broker的有效性。 详细的错误信息就不列了。 MQ服务器端日志输出[INFO]Transport failed: java.io.EOFException | org.apache.activemq.broker.TransportConnection.Transport 问题原因: MQ配置文件里配置了ProducerFlowControl='true',而且memorylimit过小导致的。 这个策略生效的方式是在它的策略里配置 <pendingQueuePolicy> <vmQueueCursor /> </pendingQueuePolicy> 才会生效。所以如果为了防止内存使用过大,可以配置相应的属性。但是,一定要设置好内存限制,否则就会出现上面的错误。 解决方式: 1、配置合理的限制。 2、另外就是去掉这个配置项。 注,当队列中数据过大的时候,虽然没有配置这个限制,也一样会出现相同的问题,所以最好不要盲目的堆积消息。
但是本地就没找到这个配置
最后放行了端口解决
命令:/sbin/iptables -I INPUT -s 流量来源ip -p tcp --dport 端口 -j ACCEPT
[root@Storage bin]# iptables -I INPUT -p tcp -s `who am i |awk -F '(' '{print $2}' |awk -F ')' '{print $1}'` --dport 61616 -j ACCEPT [root@Storage bin]# /sbin/iptables -I INPUT -s 172.20.13.10 -p tcp --dport 61616 -j ACCEPT [root@Storage bin]# /sbin/iptables -I INPUT -s 172.20.13.10 -p tcp --dport 61617 -j ACCEPT
apache官方的issues有人回答是网络不稳定/客户端反复连接,可能是这个原因?