我正在Cloud Foundry上试验Spring Cloud Data Flow(版本1.0.0.M2)。具体来说,我正在使用Bluemix来完成我的任务。
我使用这些引用来成功构建Cloud Foundry服务器: https://github.com/lshannon/spring-cloud-data-flow-demo
我启动了服务器,连接了本地shell,成功注册了默认处理器,接收器和源。
使用的环境变量($1,$2,$3,$4)
是我的个人数据:
cf set-env $APP_NAME SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_API_ENDPOINT https://api.eu-gb.bluemix.net
cf set-env $APP_NAME SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_ORGANIZATION $1
cf set-env $APP_NAME SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_SPACE $2
cf set-env $APP_NAME SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_DOMAIN eu-gb.mybluemix.net
cf set-env $APP_NAME SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_SERVICES redis01,rabbit
cf set-env $APP_NAME SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_USERNAME $3
cf set-env $APP_NAME SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_PASSWORD $4
cf set-env $APP_NAME SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_SKIP_SSL_VALIDATION false
我在Bluemix实例中仔细检查了这些变量,一切都正确。
然后我尝试使用shell重新创建基本流示例,即:
stream create luketicktock --definition "time | log" --deploy
shell输出为:
Created and deployed new stream 'luketicktock'
但是,我看不到任何部署的Cloud Foundry应用程序能够重现这样的流。
2016-07-02T18:27:34.74+0200 [RTR/0] OUT approver-dataflow-v2.eu-gb.mybluemix.net - [02/07/2016:16:27:34 +0000] "GET /streams/definitions?page=0&size=10 HTTP/1.1" 200 0 387 "http://approver-dataflow-v2.eu-gb.mybluemix.net/admin-ui/index.html" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36" 159.122.215.10:39562 x_forwarded_for:"87.14.219.53" x_forwarded_proto:"http" vcap_request_id:781a16d0-9b21-4549-4403-3b95744b936a response_time:0.046310147 app_id:59f2c573-1b54-4480-81e3-6a064260820a x_global_transaction_id:"1105927831"
2016-07-02T18:27:39.14+0200 [App/0] OUT 2016-07-02 16:27:39.143 ERROR 29 --- [io-61588-exec-5] o.s.c.d.s.c.CloudFoundryAppDeployer : Error creating app luketicktock-log
2016-07-02T18:27:39.14+0200 [App/0] OUT org.springframework.security.oauth2.client.resource.OAuth2AccessDeniedException: Error requesting access token.
2016-07-02T18:27:39.14+0200 [App/0] OUT at org.springframework.security.oauth2.client.token.OAuth2AccessTokenSupport.retrieveToken(OAuth2AccessTokenSupport.java:145) ~[spring-security-oauth2-2.0.9.RELEASE.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0] OUT at org.springframework.security.oauth2.client.token.grant.password.ResourceOwnerPasswordAccessTokenProvider.obtainAccessToken(ResourceOwnerPasswordAccessTokenProvider.java:47) ~[spring-security-oauth2-2.0.9.RELEASE.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0] OUT at org.springframework.security.oauth2.client.OAuth2RestTemplate.acquireAccessToken(OAuth2RestTemplate.java:221) ~[spring-security-oauth2-2.0.9.RELEASE.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0] OUT at org.springframework.security.oauth2.client.OAuth2RestTemplate.getAccessToken(OAuth2RestTemplate.java:173) ~[spring-security-oauth2-2.0.9.RELEASE.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0] OUT at org.springframework.security.oauth2.client.OAuth2RestTemplate.createRequest(OAuth2RestTemplate.java:105) ~[spring-security-oauth2-2.0.9.RELEASE.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0] OUT at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:592) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
2016-07-02T18:27:39.14+0200 [App/0] OUT at org.springframework.security.oauth2.client.OAuth2RestTemplate.doExecute(OAuth2RestTemplate.java:128) ~[spring-security-oauth2-2.0.9.RELEASE.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0] OUT at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:572) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
2016-07-02T18:27:39.14+0200 [App/0] OUT at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:280) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
2016-07-02T18:27:39.14+0200 [App/0] OUT at org.cloudfoundry.spring.util.AbstractSpringOperations.lambda$get$3(AbstractSpringOperations.java:85) ~[cloudfoundry-client-spring-2.0.0.M4.jar!/:2.0.0.M4]
2016-07-02T18:27:39.14+0200 [App/0] OUT at org.cloudfoundry.spring.util.AbstractSpringOperations.lambda$null$1(AbstractSpringOperations.java:66) ~[cloudfoundry-client-spring-2.0.0.M4.jar!/:2.0.0.M4]
2016-07-02T18:27:39.14+0200 [App/0] OUT at reactor.core.publisher.FluxYieldingEmitter$YieldingSignalEmitter.request(FluxYieldingEmitter.java:75) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0] OUT at reactor.core.util.DeferredSubscription.set(DeferredSubscription.java:71) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0] OUT at reactor.core.publisher.FluxSubscribeOn$SubscribeOnPipeline.onSubscribe(FluxSubscribeOn.java:129) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0] OUT at reactor.core.subscriber.SignalEmitter.start(SignalEmitter.java:170) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0] OUT at reactor.core.publisher.FluxYieldingEmitter.subscribe(FluxYieldingEmitter.java:43) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0] OUT at reactor.core.publisher.FluxFlatMap.trySubscribeScalarMap(FluxFlatMap.java:153) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0] OUT at reactor.core.publisher.FluxFlatMap.subscribe(FluxFlatMap.java:170) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0] OUT at reactor.core.publisher.FluxSubscribeOn$SourceSubscribeTask.run(FluxSubscribeOn.java:363) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0] OUT at reactor.core.publisher.Computations$ProcessorWorker.onNext(Computations.java:919) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0] OUT at reactor.core.publisher.Computations$ProcessorWorker.onNext(Computations.java:883) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0] OUT at reactor.core.publisher.WorkQueueProcessor$QueueSubscriberLoop.run(WorkQueueProcessor.java:842) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0] OUT at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_91]
2016-07-02T18:27:39.14+0200 [App/0] OUT at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:1.8.0_91]
2016-07-02T18:27:39.14+0200 [App/0] OUT at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_91]
2016-07-02T18:27:39.14+0200 [App/0] OUT Caused by: org.springframework.web.client.HttpClientErrorException: 401 Unauthorized
2016-07-02T18:27:39.14+0200 [App/0] OUT at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:91) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
2016-07-02T18:27:39.14+0200 [App/0] OUT at org.springframework.security.oauth2.client.token.OAuth2AccessTokenSupport$AccessTokenErrorHandler.handleError(OAuth2AccessTokenSupport.java:244) ~[spring-security-oauth2-2.0.9.RELEASE.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0] OUT at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:641) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
2016-07-02T18:27:39.14+0200 [App/0] OUT at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:597) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
2016-07-02T18:27:39.14+0200 [App/0] OUT at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:565) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
2016-07-02T18:27:39.14+0200 [App/0] OUT at org.springframework.security.oauth2.client.token.OAuth2AccessTokenSupport.retrieveToken(OAuth2AccessTokenSupport.java:137) ~[spring-security-oauth2-2.0.9.RELEASE.jar!/:na]
2016-07-02T18:27:39.14+0200 [App/0] OUT ... 24 common frames omitted
2016-07-02T18:27:40.70+0200 [RTR/2] OUT approver-dataflow-v2.eu-gb.mybluemix.net - [02/07/2016:16:27:40 +0000] "GET /streams/definitions?page=0&size=10 HTTP/1.1" 200 0 384 "http://approver-dataflow-v2.eu-gb.mybluemix.net/admin-ui/index.html" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36" 159.122.215.11:30146 x_forwarded_for:"87.14.219.53" x_forwarded_proto:"http" vcap_request_id:ecaaca33-cc82-4c4e-4cd8-c81a431c4f4f response_time:0.009798874 app_id:59f2c573-1b54-4480-81e3-6a064260820a x_global_transaction_id:"3460948721"
2016-07-02T18:27:43.51+0200 [App/0] OUT 2016-07-02 16:27:43.519 ERROR 29 --- [io-61588-exec-5] o.s.c.d.s.c.CloudFoundryAppDeployer : Error creating app luketicktock-time
2016-07-02T18:27:43.51+0200 [App/0] OUT org.springframework.security.oauth2.client.resource.OAuth2AccessDeniedException: Error requesting access token.
2016-07-02T18:27:43.51+0200 [App/0] OUT at org.springframework.security.oauth2.client.token.OAuth2AccessTokenSupport.retrieveToken(OAuth2AccessTokenSupport.java:145) ~[spring-security-oauth2-2.0.9.RELEASE.jar!/:na]
2016-07-02T18:27:43.51+0200 [App/0] OUT at org.springframework.security.oauth2.client.token.grant.password.ResourceOwnerPasswordAccessTokenProvider.obtainAccessToken(ResourceOwnerPasswordAccessTokenProvider.java:47) ~[spring-security-oauth2-2.0.9.RELEASE.jar!/:na]
2016-07-02T18:27:43.51+0200 [App/0] OUT at org.springframework.security.oauth2.client.OAuth2RestTemplate.acquireAccessToken(OAuth2RestTemplate.java:221) ~[spring-security-oauth2-2.0.9.RELEASE.jar!/:na]
2016-07-02T18:27:43.51+0200 [App/0] OUT at org.springframework.security.oauth2.client.OAuth2RestTemplate.getAccessToken(OAuth2RestTemplate.java:173) ~[spring-security-oauth2-2.0.9.RELEASE.jar!/:na]
2016-07-02T18:27:43.51+0200 [App/0] OUT at org.springframework.security.oauth2.client.OAuth2RestTemplate.createRequest(OAuth2RestTemplate.java:105) ~[spring-security-oauth2-2.0.9.RELEASE.jar!/:na]
2016-07-02T18:27:43.51+0200 [App/0] OUT at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:592) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
2016-07-02T18:27:43.51+0200 [App/0] OUT at org.springframework.security.oauth2.client.OAuth2RestTemplate.doExecute(OAuth2RestTemplate.java:128) ~[spring-security-oauth2-2.0.9.RELEASE.jar!/:na]
2016-07-02T18:27:43.52+0200 [App/0] OUT at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:572) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
2016-07-02T18:27:43.52+0200 [App/0] OUT at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:280) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
2016-07-02T18:27:43.52+0200 [App/0] OUT at org.cloudfoundry.spring.util.AbstractSpringOperations.lambda$get$3(AbstractSpringOperations.java:85) ~[cloudfoundry-client-spring-2.0.0.M4.jar!/:2.0.0.M4]
2016-07-02T18:27:43.52+0200 [App/0] OUT at org.cloudfoundry.spring.util.AbstractSpringOperations.lambda$null$1(AbstractSpringOperations.java:66) ~[cloudfoundry-client-spring-2.0.0.M4.jar!/:2.0.0.M4]
2016-07-02T18:27:43.52+0200 [App/0] OUT at reactor.core.publisher.FluxYieldingEmitter$YieldingSignalEmitter.request(FluxYieldingEmitter.java:75) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:43.52+0200 [App/0] OUT at reactor.core.util.DeferredSubscription.set(DeferredSubscription.java:71) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:43.52+0200 [App/0] OUT at reactor.core.publisher.FluxSubscribeOn$SubscribeOnPipeline.onSubscribe(FluxSubscribeOn.java:129) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:43.52+0200 [App/0] OUT at reactor.core.subscriber.SignalEmitter.start(SignalEmitter.java:170) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:43.52+0200 [App/0] OUT at reactor.core.publisher.FluxYieldingEmitter.subscribe(FluxYieldingEmitter.java:43) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:43.52+0200 [App/0] OUT at reactor.core.publisher.FluxFlatMap.trySubscribeScalarMap(FluxFlatMap.java:153) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:43.52+0200 [App/0] OUT at reactor.core.publisher.FluxFlatMap.subscribe(FluxFlatMap.java:170) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:43.52+0200 [App/0] OUT at reactor.core.publisher.FluxSubscribeOn$SourceSubscribeTask.run(FluxSubscribeOn.java:363) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:43.52+0200 [App/0] OUT at reactor.core.publisher.Computations$ProcessorWorker.onNext(Computations.java:919) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:43.52+0200 [App/0] OUT at reactor.core.publisher.Computations$ProcessorWorker.onNext(Computations.java:883) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:43.52+0200 [App/0] OUT at reactor.core.publisher.WorkQueueProcessor$QueueSubscriberLoop.run(WorkQueueProcessor.java:842) ~[reactor-core-2.5.0.M3.jar!/:na]
2016-07-02T18:27:43.52+0200 [App/0] OUT at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_91]
2016-07-02T18:27:43.52+0200 [App/0] OUT at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:1.8.0_91]
2016-07-02T18:27:43.52+0200 [App/0] OUT at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_91]
2016-07-02T18:27:43.52+0200 [App/0] OUT Caused by: org.springframework.web.client.HttpClientErrorException: 401 Unauthorized
2016-07-02T18:27:43.52+0200 [App/0] OUT at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:91) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
2016-07-02T18:27:43.52+0200 [App/0] OUT at org.springframework.security.oauth2.client.token.OAuth2AccessTokenSupport$AccessTokenErrorHandler.handleError(OAuth2AccessTokenSupport.java:244) ~[spring-security-oauth2-2.0.9.RELEASE.jar!/:na]
2016-07-02T18:27:43.52+0200 [App/0] OUT at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:641) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
2016-07-02T18:27:43.52+0200 [App/0] OUT at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:597) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
2016-07-02T18:27:43.52+0200 [App/0] OUT at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:565) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
2016-07-02T18:27:43.52+0200 [App/0] OUT at org.springframework.security.oauth2.client.token.OAuth2AccessTokenSupport.retrieveToken(OAuth2AccessTokenSupport.java:137) ~[spring-security-oauth2-2.0.9.RELEASE.jar!/:na]
2016-07-02T18:27:43.52+0200 [App/0] OUT ... 24 common frames omitted
似乎数据流服务器在向Bluemix请求访问令牌以创建流时失败。我做错了什么?
感谢您的支持!
答案 0 :(得分:0)
在没有有效的自签名证书的情况下部署到Cloud Foundry时通常会出现这种情况。如果这在您的开发环境中,则可以通过以下方式跳过SSL验证。
cf set-env $APP_NAME SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_SKIP_SSL_VALIDATION true
截至今天,Spring Cloud Data Flow“核心”位于RC1,Cloud Foundry implementation位于M3。正如RC1 blog中所列,有一些新的改进以及术语更改,因此强烈建议升级到最新版本。