2016-12-05 2 views
1

私はPivotal cloudfoundryとdockerで遊んでいます。現時点では、私は春のクラウドバスとともに設定サーバーのクライアントである春のブートアプリケーションを持っています。これは、cf push demo-application target/my-jar-file.jarを使用してPCFに直接プッシュすると機能します。PCF内のDocker - AMQP(春の雲のバス)経由でrabbitmqに接続できません

私は現在、アプリケーションをドッキング用のコンテナとしてパッケージ化し、cf push demo2 -o rraghur/demoでPCFにプッシュしようとしています。 PCFはコンテナを作成してデプロイしますが、春のクラウドバスは動作しません。 Spring構成は、私は、ログ

2016-11-30T22:23:58.771+05:30 [APP/0] [OUT] 2016-11-30 16:53:58.770 INFO 12 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Fetching config from server at: https://config-67936b3e-1626-46b6-8117-480654f34e49.local.pcfdev.io 
2016-11-30T22:24:00.588+05:30 [APP/0] [OUT] 2016-11-30 16:54:00.587 INFO 12 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Located environment: name=demo-application, profiles=[production], label=null, version=45c09f139492055b3a023462c852b82ae0d396a4, state=null 

に次のように見るように仕事をするしかし、私のアプリは、結合のRabbitMQ insntanceに接続できないように思わ - のような例外:すべてのサービスがあることを考えると

2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.createConnection(CachingConnectionFactory.java:547) ~[spring-rabbit-1.6.5.RELEASE.jar!/:na] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.amqp.rabbit.core.RabbitTemplate.doExecute(RabbitTemplate.java:1389) ~[spring-rabbit-1.6.5.RELEASE.jar!/:na] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] 2016-11-30 16:54:01.015 WARN 12 --- [ main] o.s.amqp.rabbit.core.RabbitAdmin : Failed to declare exchange: Exchange [name=springCloudBus, type=topic, durable=true, autoDelete=false, internal=false, arguments={}], continuing... 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused (Connection refused) 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.amqp.rabbit.support.RabbitExceptionTranslator.convertRabbitAccessException(RabbitExceptionTranslator.java:62) ~[spring-rabbit-1.6.5.RELEASE.jar!/:na] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:306) ~[spring-rabbit-1.6.5.RELEASE.jar!/:na] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:1370) ~[spring-rabbit-1.6.5.RELEASE.jar!/:na] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:1346) ~[spring-rabbit-1.6.5.RELEASE.jar!/:na] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.amqp.rabbit.core.RabbitAdmin.declareExchange(RabbitAdmin.java:157) ~[spring-rabbit-1.6.5.RELEASE.jar!/:na] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.cloud.stream.binder.rabbit.RabbitMessageChannelBinder.declareExchange(RabbitMessageChannelBinder.java:457) [spring-cloud-stream-binder-rabbit-1.1.1.RELEASE.jar!/:1.1.1.RELEASE] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.cloud.stream.binder.rabbit.RabbitMessageChannelBinder.createProducerDestinationIfNecessary(RabbitMessageChannelBinder.java:336) [spring-cloud-stream-binder-rabbit-1.1.1.RELEASE.jar!/:1.1.1.RELEASE] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.cloud.stream.binder.rabbit.RabbitMessageChannelBinder.createProducerDestinationIfNecessary(RabbitMessageChannelBinder.java:85) [spring-cloud-stream-binder-rabbit-1.1.1.RELEASE.jar!/:1.1.1.RELEASE] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.cloud.stream.binder.AbstractMessageChannelBinder.doBindProducer(AbstractMessageChannelBinder.java:98) [spring-cloud-stream-1.1.0.RELEASE.jar!/:1.1.0.RELEASE] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.cloud.stream.binder.AbstractMessageChannelBinder.doBindProducer(AbstractMessageChannelBinder.java:53) [spring-cloud-stream-1.1.0.RELEASE.jar!/:1.1.0.RELEASE] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.cloud.stream.binder.AbstractBinder.bindProducer(AbstractBinder.java:148) [spring-cloud-stream-1.1.0.RELEASE.jar!/:1.1.0.RELEASE] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.cloud.stream.binding.ChannelBindingService.bindProducer(ChannelBindingService.java:113) [spring-cloud-stream-1.1.0.RELEASE.jar!/:1.1.0.RELEASE] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.cloud.stream.binding.BindableProxyFactory.bindOutputs(BindableProxyFactory.java:208) [spring-cloud-stream-1.1.0.RELEASE.jar!/:1.1.0.RELEASE] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.cloud.stream.binding.OutputBindingLifecycle.start(OutputBindingLifecycle.java:57) [spring-cloud-stream-1.1.0.RELEASE.jar!/:1.1.0.RELEASE] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:173) [spring-context-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:51) [spring-context-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:346) [spring-context-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:149) [spring-context-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:112) [spring-context-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:879) [spring-context-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:144) [spring-boot-1.4.2.RELEASE.jar!/:1.4.2.RELEASE] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:545) [spring-context-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) [spring-boot-1.4.2.RELEASE.jar!/:1.4.2.RELEASE] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761) [spring-boot-1.4.2.RELEASE.jar!/:1.4.2.RELEASE] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371) [spring-boot-1.4.2.RELEASE.jar!/:1.4.2.RELEASE] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-1.4.2.RELEASE.jar!/:1.4.2.RELEASE] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186) [spring-boot-1.4.2.RELEASE.jar!/:1.4.2.RELEASE] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175) [spring-boot-1.4.2.RELEASE.jar!/:1.4.2.RELEASE] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at com.example.DemoApplication.main(DemoApplication.java:24) [classes!/:0.0.1-SNAPSHOT] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_111-internal] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_111-internal] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_111-internal] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_111-internal] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [app.jar:0.0.1-SNAPSHOT] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [app.jar:0.0.1-SNAPSHOT] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) [app.jar:0.0.1-SNAPSHOT] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:58) [app.jar:0.0.1-SNAPSHOT] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] Caused by: java.net.ConnectException: Connection refused (Connection refused) 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.8.0_111-internal] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[na:1.8.0_111-internal] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[na:1.8.0_111-internal] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[na:1.8.0_111-internal] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.8.0_111-internal] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at java.net.Socket.connect(Socket.java:589) ~[na:1.8.0_111-internal] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at com.rabbitmq.client.impl.FrameHandlerFactory.create(FrameHandlerFactory.java:47) ~[amqp-client-3.6.5.jar!/:na] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:822) ~[amqp-client-3.6.5.jar!/:na] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:736) ~[amqp-client-3.6.5.jar!/:na] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:293) ~[spring-rabbit-1.6.5.RELEASE.jar!/:na] 
2016-11-30T22:24:01.016+05:30 [APP/0] [OUT] ... 37 common frames omitted 
2016-11-30T22:24:01.051+05:30 [APP/0] [OUT] 2016-11-30 16:54:01.051 INFO 12 --- [ main] o.s.integration.channel.DirectChannel : Channel 'demo-application:production:0.springCloudBusOutput' has 1 subscriber(s). 

VCAP_SERVICESを介してPCFに注入されました。アプリがビルドパックやドッキング用のコンテナを介してプッシュされるかどうかにかかわらず、サービスがどのように解決/バインドされているかに違いはないはずです...また、connection refusedはネットワーキングの問題を示します。 PCFでは違った働きをしますか?

UPDATE

I cf ssh両方のバージョンへのEDとはamqp-utilsをインストールしました。それから、echo $VCAP_SERVICESに続いて、私が壊れるまで待つspringCloudBus交換でamqp-spyが続きました。 まだ春のブーツが接続を拒否する理由は考えられません!

[email protected]:~# echo $VCAP_APPLICATION                                  
{"limits":{"fds":16384,"mem":256,"disk":512},"application_name":"new-openjdk8","application_uris":["new-openjdk8.local.pcfdev.io"],"name":"new-openjdk8","space_name":"dev","spac 
e_id":"87680353-58ca-4250-84d1-91d1955acee1","uris":["new-openjdk8.local.pcfdev.io"],"application_id":"9c1244b5-70a1-4275-8d0d-bf9b54958054","version":"9710aaf6-588f-41b8-964d-3 
422c6fb525d","application_version":"9710aaf6-588f-41b8-964d-3422c6fb525d"}                          
[email protected]:~# echo $VCAP_SERVICES                                   
{"p-rabbitmq":[{ "credentials": { "http_api_uris": [ "https://13f80867-b5cb-4f36-a689-9c4215a79ef7:[email protected]/api/" ], "ssl": 
false, "dashboard_url": "https://rabbitmq-management.local.pcfdev.io/#/login/13f80867-b5cb-4f36-a689-9c4215a79ef7/if4odk9jshcda7sn74vss8vlh0", "password": "if4odk9jshcda7sn74vs 
s8vlh0", "protocols": { "management": { "path": "/api/", "ssl": false, "hosts": [ "rabbitmq.local.pcfdev.io" ], "password": "if4odk9jshcda7sn74vss8vlh0", "username": "13f80867-b 
5cb-4f36-a689-9c4215a79ef7", "port": 15672, "host": "rabbitmq.local.pcfdev.io", "uri": "http://13f80867-b5cb-4f36-a689-9c4215a79ef7:[email protected] 
dev.io:15672/api/", "uris": [ "http://13f80867-b5cb-4f36-a689-9c4215a79ef7:[email protected]:15672/api/" ] }, "amqp": { "vhost": "2fb4345b-9268 
-4865-8340-98e949067d8d", "username": "13f80867-b5cb-4f36-a689-9c4215a79ef7", "password": "if4odk9jshcda7sn74vss8vlh0", "port": 5672, "host": "rabbitmq.local.pcfdev.io", "hosts" 
: [ "rabbitmq.local.pcfdev.io" ], "ssl": false, "uri": "amqp://13f80867-b5cb-4f36-a689-9c4215a79ef7:[email protected]:5672/2fb4345b-9268-4865-8 
340-98e949067d8d", "uris": [ "amqp://13f80867-b5cb-4f36-a689-9c4215a79ef7:[email protected]:5672/2fb4345b-9268-4865-8340-98e949067d8d" ] } }, " 
username": "13f80867-b5cb-4f36-a689-9c4215a79ef7", "hostname": "rabbitmq.local.pcfdev.io", "hostnames": [ "rabbitmq.local.pcfdev.io" ], "vhost": "2fb4345b-9268-4865-8340-98e9490 
67d8d", "http_api_uri": "https://13f80867-b5cb-4f36-a689-9c4215a79ef7:[email protected]/api/", "uri": "amqp://13f80867-b5cb-4f36-a68 
9-9c4215a79ef7:[email protected]/2fb4345b-9268-4865-8340-98e949067d8d", "uris": [ "amqp://13f80867-b5cb-4f36-a689-9c4215a79ef7:if4odk9jshcda7sn 
[email protected]/2fb4345b-9268-4865-8340-98e949067d8d" ] }, "syslog_drain_url": null, "volume_mounts": [ ], "label": "p-rabbitmq", "provider": null, "plan": " 
standard", "name": "rabbitmq", "tags": [ "rabbitmq", "messaging", "message-queue", "amqp", "stomp", "mqtt", "pivotal" ] }],"p-config-server":[{ "credentials": { "uri": "https:// 
config-67936b3e-1626-46b6-8117-480654f34e49.local.pcfdev.io", "client_secret": "qSB9z4tI0Vix", "client_id": "p-config-server-f5c46df9-08f0-4779-bac1-3e2096a5efd6", "access_token 
_uri": "https://p-spring-cloud-services.uaa.local.pcfdev.io/oauth/token" }, "syslog_drain_url": null, "volume_mounts": [ ], "label": "p-config-server", "provider": null, "plan": 
"standard", "name": "config-server", "tags": [ "configuration", "spring-cloud" ] }]}                        
[email protected]:~# /usr/local/bin/amqp-spy -H rabbitmq.local.pcfdev.io -u 13f80867-b5cb-4f36-a689-9c4215a79ef7 --password if4odk9jshcda7sn74vss8vlh0 -V 2fb4345b-9268-4865-8340 
-98e949067d8d springCloudBus                                     
^Ccan't be called from trap context 
+0

デバッグに 'cf ssh'を使ってみましたか? –

+0

'amqp-utils'を実行するように管理しました。質問の更新を追加しました。 – Raghu

+0

dockerの起動アプリケーションがrabbitmqに接続できないという同様の問題に直面しています。 PCFでアプリを起動している間にログを詳しく調べると、org.springframework.amqp.rabbit.connection.ConnectionFactory **の自動再構成が行われません。したがって、アプリケーションがrabbitmqを検索しようとすると、localhost上でそうすることになり、上記のエラーが発生します。 – naav

答えて

0

@Raghuあなたはアクティブなプロファイルが再構成やRabbitMQのサービスにアプリを結合するためのキーである「クラウド」を、含まれていないようだと思われるうちpost'edているログから。

関連する問題