SpringAMQP+springboot+docker

  • Post author:
  • Post category:其他


原文地址


springcloud配置中心远程连接rabbitmq报错socket closed,An unexpected connection driver error occured – 向零 – 博客园 (cnblogs.com)

启动报错信息

错误信息:


java.net.SocketException: socket closed at java.net.SocketInputStream.socketRead0(SocketInputStream.java) ~[na:1.8.0_271] at java.net.SocketInputStream.socketRead(SocketInputStream.java:116) ~[na:1.8.0_271] at java.net.SocketInputStream.read(SocketInputStream.java:171) ~[na:1.8.0_271] at java.net.SocketInputStream.read(SocketInputStream.java:141) ~[na:1.8.0_271] at java.io.BufferedInputStream.fill(BufferedInputStream.java:246) ~[na:1.8.0_271] at java.io.BufferedInputStream.read(BufferedInputStream.java:265) ~[na:1.8.0_271] at java.io.DataInputStream.readUnsignedByte(DataInputStream.java:288) ~[na:1.8.0_271] at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:91) ~[amqp-client-5.9.0.jar:5.9.0] at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:184) ~[amqp-client-5.9.0.jar:5.9.0] at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:665) ~[amqp-client-5.9.0.jar:5.9.0] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_271] 2021-01-15 10:25:22.519 INFO 7324 — [ main] o.s.a.r.c.CachingConnectionFactory : Attempting to connect to: [192.168.0.58:5672] 2021-01-15 10:25:22.635 ERROR 7324 — [2.168.0.58:5672] c.r.c.impl.ForgivingExceptionHandler : An unexpected connection driver error occured java.net.SocketException: socket closed at java.net.SocketInputStream.socketRead0(SocketInputStream.java) ~[na:1.8.0_271] at java.net.SocketInputStream.socketRead(SocketInputStream.java:116) ~[na:1.8.0_271] at java.net.SocketInputStream.read(SocketInputStream.java:171) ~[na:1.8.0_271] at java.net.SocketInputStream.read(SocketInputStream.java:141) ~[na:1.8.0_271] at java.io.BufferedInputStream.fill(BufferedInputStream.java:246) ~[na:1.8.0_271] at java.io.BufferedInputStream.read(BufferedInputStream.java:265) ~[na:1.8.0_271] at java.io.DataInputStream.readUnsignedByte(DataInputStream.java:288) ~[na:1.8.0_271] at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:91) ~[amqp-client-5.9.0.jar:5.9.0] at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:184) ~[amqp-client-5.9.0.jar:5.9.0] at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:665) ~[amqp-client-5.9.0.jar:5.9.0] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_271] 2021-01-15 10:25:22.655 INFO 7324 — [ main] o.s.c.stream.binder.BinderErrorChannel : Channel ‘springCloudBus.anonymous.0paQVw0mSXC7784rkP-7Ow.errors’ has 1 subscriber(s). 2021-01-15 10:25:22.655 INFO 7324 — [ main] o.s.c.stream.binder.BinderErrorChannel : Channel ‘springCloudBus.anonymous.0paQVw0mSXC7784rkP-7Ow.errors’ has 2 subscriber(s). 2021-01-15 10:25:22.659 INFO 7324 — [ main] o.s.a.r.c.CachingConnectionFactory : Attempting to connect to: [192.168.0.58:5672] 2021-01-15 10:25:22.774 INFO 7324 — [ main] o.s.a.r.l.SimpleMessageListenerContainer : Broker not available; cannot force queue declarations during start: com.rabbitmq.client.AuthenticationFailureException: ACCESS_REFUSED – Login was refused using authentication mechanism PLAIN. For details see the broker logfile. 2021-01-15 10:25:22.775 ERROR 7324 — [2.168.0.58:5672] c.r.c.impl.ForgivingExceptionHandler : An unexpected connection driver error occured java.net.SocketException: Socket Closed at java.net.SocketInputStream.socketRead0(SocketInputStream.java) ~[na:1.8.0_271] at java.net.SocketInputStream.socketRead(SocketInputStream.java:116) ~[na:1.8.0_271] at java.net.SocketInputStream.read(SocketInputStream.java:171) ~[na:1.8.0_271] at java.net.SocketInputStream.read(SocketInputStream.java:141) ~[na:1.8.0_271] at java.io.BufferedInputStream.fill(BufferedInputStream.java:246) ~[na:1.8.0_271] at java.io.BufferedInputStream.read(BufferedInputStream.java:265) ~[na:1.8.0_271] at java.io.DataInputStream.readUnsignedByte(DataInputStream.java:288) ~[na:1.8.0_271] at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:91) ~[amqp-client-5.9.0.jar:5.9.0] at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:184) ~[amqp-client-5.9.0.jar:5.9.0] at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:665) ~[amqp-client-5.9.0.jar:5.9.0] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_271] 2021-01-15 10:25:22.792 INFO 7324 — [XC7784rkP-7Ow-1] o.s.a.r.c.CachingConnectionFactory : Attempting to connect to: [192.168.0.58:5672] 2021-01-15 10:25:22.911 ERROR 7324 — [2.168.0.58:5672] c.r.c.impl.ForgivingExceptionHandler : An unexpected connection driver error occured java.net.SocketException: socket closed at java.net.SocketInputStream.socketRead0(SocketInputStream.java) ~[na:1.8.0_271] at java.net.SocketInputStream.socketRead(SocketInputStream.java:116) ~[na:1.8.0_271] at java.net.SocketInputStream.read(SocketInputStream.java:171) ~[na:1.8.0_271] at java.net.SocketInputStream.read(SocketInputStream.java:141) ~[na:1.8.0_271] at java.io.BufferedInputStream.fill(BufferedInputStream.java:246) ~[na:1.8.0_271] at java.io.BufferedInputStream.read(BufferedInputStream.java:265) ~[na:1.8.0_271] at java.io.DataInputStream.readUnsignedByte(DataInputStream.java:288) ~[na:1.8.0_271] at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:91) ~[amqp-client-5.9.0.jar:5.9.0] at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:184) ~[amqp-client-5.9.0.jar:5.9.0] at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:665) ~[amqp-client-5.9.0.jar:5.9.0] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_271] 2021-01-15 10:25:22.913 ERROR 7324 — [XC7784rkP-7Ow-1] o.s.a.r.l.SimpleMessageListenerContainer : Consumer received fatal exception on startup org.springframework.amqp.rabbit.listener.exception.FatalListenerStartupException: Authentication failure at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.start(BlockingQueueConsumer.java:566) ~[spring-rabbit-2.2.9.RELEASE.jar:2.2.9.RELEASE] at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.initialize(SimpleMessageListenerContainer.java:1350) ~[spring-rabbit-2.2.9.RELEASE.jar:2.2.9.RELEASE] at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1195) ~[spring-rabbit-2.2.9.RELEASE.jar:2.2.9.RELEASE] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_271] Caused by: org.springframework.amqp.AmqpAuthenticationException: com.rabbitmq.client.AuthenticationFailureException: ACCESS_REFUSED – Login was refused using authentication mechanism PLAIN. For details see the broker logfile. at org.springframework.amqp.rabbit.support.RabbitExceptionTranslator.convertRabbitAccessException(RabbitExceptionTranslator.java:64) ~[spring-rabbit-2.2.9.RELEASE.jar:2.2.9.RELEASE] at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:524) ~[spring-rabbit-2.2.9.RELEASE.jar:2.2.9.RELEASE] at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.createConnection(CachingConnectionFactory.java:751) ~[spring-rabbit-2.2.9.RELEASE.jar:2.2.9.RELEASE] at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils.createConnection(ConnectionFactoryUtils.java:214) ~[spring-rabbit-2.2.9.RELEASE.jar:2.2.9.RELEASE] at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils$RabbitResourceFactory.createConnection(ConnectionFactoryUtils.java:293) ~[spring-rabbit-2.2.9.RELEASE.jar:2.2.9.RELEASE] at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils.doGetTransactionalResourceHolder(ConnectionFactoryUtils.java:130) ~[spring-rabbit-2.2.9.RELEASE.jar:2.2.9.RELEASE] at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils.getTransactionalResourceHolder(ConnectionFactoryUtils.java:92) ~[spring-rabbit-2.2.9.RELEASE.jar:2.2.9.RELEASE] at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils.getTransactionalResourceHolder(ConnectionFactoryUtils.java:75) ~[spring-rabbit-2.2.9.RELEASE.jar:2.2.9.RELEASE] at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.start(BlockingQueueConsumer.java:560) ~[spring-rabbit-2.2.9.RELEASE.jar:2.2.9.RELEASE] … 3 common frames omitted Caused by: com.rabbitmq.client.AuthenticationFailureException: ACCESS_REFUSED – Login was refused using authentication mechanism PLAIN. For details see the broker logfile. at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:385) ~[amqp-client-5.9.0.jar:5.9.0] at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1139) ~[amqp-client-5.9.0.jar:5.9.0] at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1087) ~[amqp-client-5.9.0.jar:5.9.0] at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.connectAddresses(AbstractConnectionFactory.java:560) ~[spring-rabbit-2.2.9.RELEASE.jar:2.2.9.RELEASE] at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.connect(AbstractConnectionFactory.java:533) ~[spring-rabbit-2.2.9.RELEASE.jar:2.2.9.RELEASE] at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:487) ~[spring-rabbit-2.2.9.RELEASE.jar:2.2.9.RELEASE] … 10 common frames omitted 2021-01-15 10:25:22.917 ERROR 7324 — [ main] o.s.cloud.stream.binding.BindingService : Failed to create consumer binding; retrying in 30 seconds org.springframework.cloud.stream.binder.BinderException: Exception thrown while starting consumer: at org.springframework.cloud.stream.binder.AbstractMessageChannelBinder.doBindConsumer(AbstractMessageChannelBinder.java:461) ~[spring-cloud-stream-3.0.8.RELEASE.jar:3.0.8.RELEASE] at org.springframework.cloud.stream.binder.AbstractMessageChannelBinder.doBindConsumer(AbstractMessageChannelBinder.java:90) ~[spring-cloud-stream-3.0.8.RELEASE.jar:3.0.8.RELEASE] at org.springframework.cloud.stream.binder.AbstractBinder.bindConsumer(AbstractBinder.java:143) ~[spring-cloud-stream-3.0.8.RELEASE.jar:3.0.8.RELEASE] at org.springframework.cloud.stream.binding.BindingService.doBindConsumer(BindingService.java:176) [spring-cloud-stream-3.0.8.RELEASE.jar:3.0.8.RELEASE] at org.springframework.cloud.stream.binding.BindingService.bindConsumer(BindingService.java:133) [spring-cloud-stream-3.0.8.RELEASE.jar:3.0.8.RELEASE] at org.springframework.cloud.stream.binding.AbstractBindableProxyFactory.createAndBindInputs(AbstractBindableProxyFactory.java:112) [spring-cloud-stream-3.0.8.RELEASE.jar:3.0.8.RELEASE] at org.springframework.cloud.stream.binding.InputBindingLifecycle.doStartWithBindable(InputBindingLifecycle.java:58) [spring-cloud-stream-3.0.8.RELEASE.jar:3.0.8.RELEASE] at java.util.LinkedHashMap$LinkedValues.forEach(LinkedHashMap.java:608) ~[na:1.8.0_271] at org.springframework.cloud.stream.binding.AbstractBindingLifecycle.start(AbstractBindingLifecycle.java:57) ~[spring-cloud-stream-3.0.8.RELEASE.jar:3.0.8.RELEASE] at org.springframework.cloud.stream.binding.InputBindingLifecycle.start(InputBindingLifecycle.java:34) [spring-cloud-stream-3.0.8.RELEASE.jar:3.0.8.RELEASE] at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:182) ~[spring-context-5.2.8.RELEASE.jar:5.2.8.RELEASE] at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:53) ~[spring-context-5.2.8.RELEASE.jar:5.2.8.RELEASE] at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:360) ~[spring-context-5.2.8.RELEASE.jar:5.2.8.RELEASE] at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:158) ~[spring-context-5.2.8.RELEASE.jar:5.2.8.RELEASE] at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:122) ~[spring-context-5.2.8.RELEASE.jar:5.2.8.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:895) ~[spring-context-5.2.8.RELEASE.jar:5.2.8.RELEASE] at org.springframework.context.support.AbstractApplicationContext.__refresh(AbstractApplicationContext.java:554) ~[spring-context-5.2.8.RELEASE.jar:5.2.8.RELEASE] at org.springframework.context.support.AbstractApplicationContext.jrLockAndRefresh(AbstractApplicationContext.java:40002) ~[spring-context-5.2.8.RELEASE.jar:5.2.8.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:41008) ~[spring-context-5.2.8.RELEASE.jar:5.2.8.RELEASE] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) ~[spring-boot-2.3.2.RELEASE.jar:2.3.2.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) ~[spring-boot-2.3.2.RELEASE.jar:2.3.2.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) ~[spring-boot-2.3.2.RELEASE.jar:2.3.2.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[spring-boot-2.3.2.RELEASE.jar:2.3.2.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-2.3.2.RELEASE.jar:2.3.2.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) ~[spring-boot-2.3.2.RELEASE.jar:2.3.2.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.3.2.RELEASE.jar:2.3.2.RELEASE] at org.moonholder.cloud.ConfigServerApplication.main(ConfigServerApplication.java:13) ~[classes/:na] Caused by: org.springframework.amqp.AmqpIllegalStateException: Fatal exception on listener startup at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.waitForConsumersToStart(SimpleMessageListenerContainer.java:614) ~[spring-rabbit-2.2.9.RELEASE.jar:2.2.9.RELEASE] at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.doStart(SimpleMessageListenerContainer.java:575) ~[spring-rabbit-2.2.9.RELEASE.jar:2.2.9.RELEASE] at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.start(AbstractMessageListenerContainer.java:1313) ~[spring-rabbit-2.2.9.RELEASE.jar:2.2.9.RELEASE] at org.springframework.integration.amqp.inbound.AmqpInboundChannelAdapter.doStart(AmqpInboundChannelAdapter.java:210) ~[spring-integration-amqp-5.3.2.RELEASE.jar:5.3.2.RELEASE] at org.springframework.integration.endpoint.AbstractEndpoint.start(AbstractEndpoint.java:156) ~[spring-integration-core-5.3.2.RELEASE.jar:5.3.2.RELEASE] at org.springframework.cloud.stream.binder.AbstractMessageChannelBinder.doBindConsumer(AbstractMessageChannelBinder.java:414) ~[spring-cloud-stream-3.0.8.RELEASE.jar:3.0.8.RELEASE] … 26 common frames omitted Caused by: org.springframework.amqp.rabbit.listener.exception.FatalListenerStartupException: Authentication failure at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.start(BlockingQueueConsumer.java:566) ~[spring-rabbit-2.2.9.RELEASE.jar:2.2.9.RELEASE] at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.initialize(SimpleMessageListenerContainer.java:1350) ~[spring-rabbit-2.2.9.RELEASE.jar:2.2.9.RELEASE] at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1195) ~[spring-rabbit-2.2.9.RELEASE.jar:2.2.9.RELEASE] at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_271] Caused by: org.springframework.amqp.AmqpAuthenticationException: com.rabbitmq.client.AuthenticationFailureException: ACCESS_REFUSED – Login was refused using authentication mechanism PLAIN. For details see the broker logfile. at org.springframework.amqp.rabbit.support.RabbitExceptionTranslator.convertRabbitAccessException(RabbitExceptionTranslator.java:64) ~[spring-rabbit-2.2.9.RELEASE.jar:2.2.9.RELEASE] at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:524) ~[spring-rabbit-2.2.9.RELEASE.jar:2.2.9.RELEASE] at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.createConnection(CachingConnectionFactory.java:751) ~[spring-rabbit-2.2.9.RELEASE.jar:2.2.9.RELEASE] at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils.createConnection(ConnectionFactoryUtils.java:214) ~[spring-rabbit-2.2.9.RELEASE.jar:2.2.9.RELEASE] at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils$RabbitResourceFactory.createConnection(ConnectionFactoryUtils.java:293) ~[spring-rabbit-2.2.9.RELEASE.jar:2.2.9.RELEASE] at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils.doGetTransactionalResourceHolder(ConnectionFactoryUtils.java:130) ~[spring-rabbit-2.2.9.RELEASE.jar:2.2.9.RELEASE] at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils.getTransactionalResourceHolder(ConnectionFactoryUtils.java:92) ~[spring-rabbit-2.2.9.RELEASE.jar:2.2.9.RELEASE] at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils.getTransactionalResourceHolder(ConnectionFactoryUtils.java:75) ~[spring-rabbit-2.2.9.RELEASE.jar:2.2.9.RELEASE] at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.start(BlockingQueueConsumer.java:560) ~[spring-rabbit-2.2.9.RELEASE.jar:2.2.9.RELEASE] … 3 common frames omitted Caused by: com.rabbitmq.client.AuthenticationFailureException: ACCESS_REFUSED – Login was refused using authentication mechanism PLAIN. For details see the broker logfile. at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:385) ~[amqp-client-5.9.0.jar:5.9.0] at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1139) ~[amqp-client-5.9.0.jar:5.9.0] at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1087) ~[amqp-client-5.9.0.jar:5.9.0] at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.connectAddresses(AbstractConnectionFactory.java:560) ~[spring-rabbit-2.2.9.RELEASE.jar:2.2.9.RELEASE] at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.connect(AbstractConnectionFactory.java:533) ~[spring-rabbit-2.2.9.RELEASE.jar:2.2.9.RELEASE] at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:487) ~[spring-rabbit-2.2.9.RELEASE.jar:2.2.9.RELEASE] … 10 common frames omitted 2021-01-15 10:25:22.922 ERROR 7324 — [XC7784rkP-7Ow-1] o.s.a.r.l.SimpleMessageListenerContainer : Stopping container from aborted consumer 2021-01-15 10:25:22.923 INFO 7324 — [XC7784rkP-7Ow-1] o.s.a.r.l.SimpleMessageListenerContainer : Waiting for workers to finish. 2021-01-15 10:25:22.923 INFO 7324 — [XC7784rkP-7Ow-1] o.s.a.r.l.SimpleMessageListenerContainer : Successfully waited for workers to finish. 2021-01-15 10:25:22.994 INFO 7324 — [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 3344 (http) with context path ” 2021-01-15 10:25:22.996 INFO 7324 — [ main] .s.c.n.e.s.EurekaAutoServiceRegistration : Updating port to 3344 2021-01-15 10:25:23.113 INFO 7324 — [ main] o.m.cloud.ConfigServerApplication : Started ConfigServerApplication in 14.245 seconds (JVM running for 22.569) 2021-01-15 10:25:52.290 INFO 7324 — [freshExecutor-0] com.netflix.discovery.DiscoveryClient : Disable delta property : false 2021-01-15 10:25:52.290 INFO 7324 — [freshExecutor-0] com.netflix.discovery.DiscoveryClient : Single vip registry refresh property : null 2021-01-15 10:25:52.291 INFO 7324 — [freshExecutor-0] com.netflix.discovery.DiscoveryClient : Force full registry fetch : false 2021-01-15 10:25:52.291 INFO 7324 — [freshExecutor-0] com.netflix.discovery.DiscoveryClient : Application is null : false 2021-01-15 10:25:52.291 INFO 7324 — [freshExecutor-0] com.netflix.discovery.DiscoveryClient : Registered Applications size is zero : true 2021-01-15 10:25:52.291 INFO 7324 — [freshExecutor-0] com.netflix.discovery.DiscoveryClient : Application version is -1: false 2021-01-15 10:25:52.291 INFO 7324 — [freshExecutor-0] com.netflix.discovery.DiscoveryClient : Getting all instance registry info from the eureka server 2021-01-15 10:25:52.389 INFO 7324 — [freshExecutor-0] com.netflix.discovery.DiscoveryClient : The response status is 200 2021-01-15 10:25:52.924 INFO 7324 — [ask-scheduler-1] c.s.b.r.p.RabbitExchangeQueueProvisioner : declaring queue for inbound: springCloudBus.anonymous.Q3455sgLTrqgu1qEp65nlw, bound to: springCloudBus 2021-01-15 10:25:52.925 INFO 7324 — [ask-scheduler-1] o.s.a.r.c.CachingConnectionFactory : Attempting to connect to: [192.168.0.58:5672] 2021-01-15 10:25:52.931 INFO 7324 — [ask-scheduler-1] o.s.a.r.c.CachingConnectionFactory : Attempting to connect to: [192.168.0.58:5672] 2021-01-15 10:25:52.932 ERROR 7324 — [2.168.0.58:5672] c.r.c.impl.ForgivingExceptionHandler : An unexpected connection driver error occured java.net.SocketException: socket closed at java.net.SocketInputStream.socketRead0(SocketInputStream.java) ~[na:1.8.0_271] at java.net.SocketInputStream.socketRead(SocketInputStream.java:116) ~[na:1.8.0_271] at java.net.SocketInputStream.read(SocketInputStream.java:171) ~[na:1.8.0_271] at java.net.SocketInputStream.read(SocketInputStream.java:141) ~[na:1.8.0_271] at java.io.BufferedInputStream.fill(BufferedInputStream.java:246) ~[na:1.8.0_271] at java.io.BufferedInputStream.read(BufferedInputStream.java:265) ~[na:1.8.0_271] at java.io.DataInputStream.readUnsignedByte(DataInputStream.java:288) ~[na:1.8.0_271] at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:91) ~[amqp-client-5.9.0.jar:5.9.0] at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:184) ~[amqp-client-5.9.0.jar:5.9.0] at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:665) ~[amqp-client-5.9.0.jar:5.9.0] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_271] 2021-01-15 10:25:53.053 ERROR 7324 — [2.168.0.58:5672] c.r.c.impl.ForgivingExceptionHandler : An unexpected connection driver error occured


原因:


使用远程连接rabbitmq需要注意不要使用默认的guset账户,guest只能进行本地登录即(localhost),应新建用户配置权限进行远程访问。


解决方法:

新建用户:

设置权限:

修改yml配置:


spring: application: name: config-server rabbitmq: host: 192.168.0.58 port: 5672 username: moonholder password: 123456