1、嗯,问题呢,就是一开始安装好RabbitMQ,练习了一下RabbitMQ的使用,但是呢,过了一段时间,我来复习的时候,发现运行出现下面的错误了。后来想想,是自己学习微服务的时候,修改了/etc/hosts的映射。后来又修改回去了,是不是感觉日了🐕了。解决方法如下所示:
eclipse远程连接服务器上面的Rabbitmq报的错误如下所示:
1 org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused: connect 2 at org.springframework.amqp.rabbit.support.RabbitExceptionTranslator.convertRabbitAccessException(RabbitExceptionTranslator.java:62) ~[spring-rabbit-2.1.2.RELEASE.jar:2.1.2.RELEASE] 3 at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:509) ~[spring-rabbit-2.1.2.RELEASE.jar:2.1.2.RELEASE] 4 at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.createConnection(CachingConnectionFactory.java:684) ~[spring-rabbit-2.1.2.RELEASE.jar:2.1.2.RELEASE] 5 at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils.createConnection(ConnectionFactoryUtils.java:214) ~[spring-rabbit-2.1.2.RELEASE.jar:2.1.2.RELEASE] 6 at org.springframework.amqp.rabbit.cor