Inleiding
Dit document beschrijft hoe de fout "Verbinding geweigerd" in de Cisco Cloud Orchestrator (CCO) kan worden opgelost wanneer hij probeert verbinding te maken met Rabbit
Voorwaarden
Vereisten
- De informatie in dit document is gebaseerd op CloudCenter 4.x
- Cisco Cloud-orchestrator (CCO)
- Rabbit Server (AMQP)
- worteltoegang tot CCO en AMQP
De informatie in dit document is gebaseerd op de apparaten in een specifieke laboratoriumomgeving. Alle apparaten die in dit document worden beschreven, hadden een opgeschoonde (standaard)configuratie. Als uw netwerk live is, moet u de potentiële impact van elke opdracht begrijpen.
Probleem
In nieuwe implementaties of na een verandering in de Rabbit server hostname ontvangt de CCO een fout om de handdruk met Rabbit op te zetten met de volgende FOUT
2018-04-17 23:58:52,180 ERROR listener.SimpleMessageListenerContainer [rabbitListenerContainer-1] - Failed to check/redeclare auto-delete queue(s).
org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused (Connection refused)
at org.springframework.amqp.rabbit.support.RabbitExceptionTranslator.convertRabbitAccessException(RabbitExceptionTranslator.java:62) ~[spring-rabbit-1.7.4.RELEASE.jar!/:?]
at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:368) ~[spring-rabbit-1.7.4.RELEASE.jar!/:?]
at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.createConnection(CachingConnectionFactory.java:573) ~[spring-rabbit-1.7.4.RELEASE.jar!/:?]
at org.springframework.amqp.rabbit.core.RabbitTemplate.doExecute(RabbitTemplate.java:1430) ~[spring-rabbit-1.7.4.RELEASE.jar!/:?]
at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:1411) ~[spring-rabbit-1.7.4.RELEASE.jar!/:?]
at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:1387) ~[spring-rabbit-1.7.4.RELEASE.jar!/:?]
at org.springframework.amqp.rabbit.core.RabbitAdmin.getQueueProperties(RabbitAdmin.java:336) ~[spring-rabbit-1.7.4.RELEASE.jar!/:?]
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.redeclareElementsIfNecessary(SimpleMessageListenerContainer.java:1171) [spring-rabbit-1.7.4.RELEASE.jar!/:?]
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1422) [spring-rabbit-1.7.4.RELEASE.jar!/:?]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_162]
Caused by: java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method) ~[?:1.8.0_162]
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[?:1.8.0_162]
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[?:1.8.0_162]
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[?:1.8.0_162]
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[?:1.8.0_162]
at java.net.Socket.connect(Socket.java:589) ~[?:1.8.0_162]
at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:673) ~[?:1.8.0_162]
at com.rabbitmq.client.impl.SocketFrameHandlerFactory.create(SocketFrameHandlerFactory.java:50) ~[amqp-client-4.0.3.jar!/:4.0.3]
at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:907) ~[amqp-client-4.0.3.jar!/:4.0.3]
at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:859) ~[amqp-client-4.0.3.jar!/:4.0.3]
at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:799) ~[amqp-client-4.0.3.jar!/:4.0.3]
at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:352) ~[spring-rabbit-1.7.4.RELEASE.jar!/:?]
... 8 more
Oplossing
Stap 1. Meld u aan bij de Rabbit-server
Stap 2. Maak een lijst van de verbindingen in de Rabbit server
[root@rabbit-490 ~]# rabbitmqctl list_connections -p /cliqr
Listing connections
Stap 3. Zoek het RABBITINSTALLED-bestand
[root@rabbit-490 ~]# ls -lrt /usr/local/osmosix/etc/.RABBITINSTALLED
-rw-r--r-- 1 root root 0 Apr 17 23:40 /usr/local/osmosix/etc/.RABBITINSTALLED
Stap 4. Verwijder het bestand.
[root@rabbit-490 ~]# rm -rf /usr/local/osmosix/etc/.RABBITINSTALLED
[root@rabbit-490 ~]# ls -lrt /usr/local/osmosix/etc/.RABBITINSTALLED
[root@rabbit-490 ~]#
Stap 5. Start het bestand rabbit_fig.sh
[root@rabbit-490 ~]# cd /usr/local/cliqr/bin/
root@rabbit-490 bin]# ls -lrt
total 80
-rwxr-xr-x 1 cliqruser cliqruser 23235 Apr 9 16:12 wizard_util.sh
-rwxr-xr-x 1 cliqruser cliqruser 12133 Apr 9 16:12 props_migration_481_to_482.sh
-rw-r--r-- 1 cliqruser cliqruser 236 Apr 9 16:12 props_481_to_482_rabbit.csv
-rwxr-xr-x 1 cliqruser cliqruser 4004 Apr 9 16:12 gua_config_wizard.sh
-rwxr-xr-x 1 cliqruser cliqruser 3553 Apr 9 16:12 gua_config_cli.sh
-rwxr-xr-x 1 cliqruser cliqruser 8966 Apr 10 02:40 rabbit_config_cli.sh
-rwxr-xr-x 1 cliqruser cliqruser 9394 Apr 10 02:40 rabbit_config_wizard.sh
-rwxr-xr-x 1 cliqruser cliqruser 1290 Apr 10 02:41 rabbit_config.sh
-rwxr-xr-x 1 cliqruser cliqruser 279 Apr 10 02:41 startup_services.sh
[root@rabbit-490 bin]# ./rabbit_config.sh
Adding vhost /cliqr
Creating vhost "/cliqr"
Adding user cliqr
Creating user "cliqr"
Setting permissions for user "cliqr" in vhost "/cliqr"
Setting cliqr as admin
Setting tags for user "cliqr" to [administrator]
Enable management plugin
Plugin configuration unchanged.
Applying plugin configuration to rabbit@rabbit-490... nothing to do.
Adding cliqr_worker
Creating user "cliqr_worker"
Setting permissions for user "cliqr_worker" in vhost "/cliqr"
Stap 6. Meld u aan bij CCO als wortel
Stap 7. Start de CO-service opnieuw
[root@cco-490 ~]# systemctl start cco
[root@cco-490 ~]#
Stap 8. Controleer dat CCO actief is
[root@cco-490 ~]# systemctl status cco
● cco.service - Cloud Center Orchestrator
Loaded: loaded (/etc/systemd/system/cco.service; enabled; vendor preset: disabled)
Active: active (exited) since Wed 2018-04-18 22:02:09 UTC; 5min ago
Process: 3329 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 3329 (code=exited, status=0/SUCCESS)
Tasks: 0
Memory: 0B
CGroup: /system.slice/cco.service
Apr 18 22:02:09 cco-490 systemd[1]: Starting Cloud Center Orchestrator...
Apr 18 22:02:09 cco-490 systemd[1]: Started Cloud Center Orchestrator.
[root@cco-490 ~]#
Stap 9. Meld u aan bij konijn als wortel
Stap 10. Geef het aantal verbindingen op
[root@rabbit-490 bin]# rabbitmqctl list_connections -p /cliqr
Listing connections
cliqr_worker 10.31.127.24 50556 running
cliqr 10.31.127.24 50568 running
U kunt nu zien naar een verbinding met CCO, cliqr_worker en een kliqr.