无法在 Spring Cloud Data Flow Pivotal Cloud Foundry 上启动任务 [英] Unable to launch task on Spring Cloud Data Flow Pivotal Cloud Foundry

查看:36
本文介绍了无法在 Spring Cloud Data Flow Pivotal Cloud Foundry 上启动任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

系统信息

Spring Cloud 数据流 Cloud Foundry:v1.1.0.RELEASEPivotal Cloud Foundry:v1.7.12CF 客户端(Windows):cf.exe 版本 6.23.1+a70deb3.2017-01-13cf-v3-plugin: 0.6.7

Spring Cloud Data Flow Cloud Foundry: v1.1.0.RELEASE Pivotal Cloud Foundry: v1.7.12 CF Client (Windows): cf.exe version 6.23.1+a70deb3.2017-01-13 cf-v3-plugin: 0.6.7

启动不带参数的时间戳任务应用程序失败.来自 Spring Cloud Data Flow Server 的日志在 https://gist.github.com/anonymous 上显示以下堆栈跟踪/420f3928b7831a11b378fc6792be1ffc.

Launching the timestamp task app with no parameters fails. Logs from Spring Cloud Data Flow Server show the following stack trace at https://gist.github.com/anonymous/420f3928b7831a11b378fc6792be1ffc.

运行 cf v3-apps 输出

name          total_desired_instances
ticktock-ts   0

然后 cf v3-rt ticktock-ts start now 产生

OK

Running task start on app ticktock-ts...

Tailing logs for app ticktock-ts...

Failed to run task start:
{   "code": 330002,   "description": "Feature Disabled: task_creation",   "error_code": "CF-FeatureDisabled"}

此 task_creation 功能已禁用,我的 PCF 管理员说无法在我们拥有的 PCF 版本上启用它.

This task_creation feature is disabled and my PCF admin says it cannot be enabled on the PCF version we have.

谢谢.

推荐答案

我们也为 1.7 版本的 PCF 安装完成了.

We have done it for our PCF installation of 1.7 version as well.

以下来自我们的笔记和学习,我们在高峰期进行了尝试.我希望它有所帮助.

Below is from our notes and learning that we made during the spike to try it out. I hope it helps.

Spring Cloud Task 允许用户使用 Spring Cloud 开发和运行短期微服务,并在本地、云中甚至在 Spring Cloud Data Flow 上运行它们.我们使用了示例 Spring Cloud 应用程序:thumbnail-generator 作为我们用例的短暂微服务.

Spring Cloud Task allows a user to develop and run shortlived microservices using Spring Cloud and run them locally, in the cloud, even on Spring Cloud Data Flow. We have used the sample Spring Cloud application : thumbnail-generator as the shortlived microservice for our usecase.

关于 Spring Cloud Task 的详细参考指南位于 spring docs.

Detailed reference guide about Spring Cloud Task is at spring docs.

请注意,我们使用了 Rabbit Binder,为此在 PCF 空间中创建了一个 RabbitMq 实例,并使用下面解释的变量绑定到应用程序.

Please note that, the we have used Rabbit Binder and for that to work a RabbitMq instance is created in the PCF Space and bound to the app using the variable explained below.

步骤和命令

  • 在本地 maven 中开发和安装 Task 应用程序 - mvn clean install

设置 Maven 远程仓库,如果想使用私有仓库进行其他依赖下载:导出 MAVEN_REMOTE_REPOSITORIES_REPO1_URL=YOUR_NEXUS_URL

Set Maven remote repo, if want to use private one for other dependency downloads: export MAVEN_REMOTE_REPOSITORIES_REPO1_URL=YOUR_NEXUS_URL

设置 Cloud Foundry 目标:<代码>export SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_URL=PCF API 端点export SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_ORG=组织名称export SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_SPACE=空间名称export SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_DOMAIN=站点域export SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_USERNAME=用户名export SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_PASSWORD=密码export SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_SKIP_SSL_VALIDATION=trueexport SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_STREAM_STAGING_TIMEOUT=300sexport SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_STREAM_STARTUP_TIMEOUT=300sexport SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_STREAM_BUILDACK=java_buildpack_offline export SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_STREAM_MEMORY=512出口 SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_TASK_MEMORY=512export SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_STREAM_ENABLE_RANDOM_APP_NAME_PREFIX=falseexport SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_STREAM_SERVICES=myMessageStream_rabbitmq_server

Setup Cloud Foundry destination: export SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_URL=PCF API Endpoint export SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_ORG=Org Name export SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_SPACE=Space Name export SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_DOMAIN=Site domain export SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_USERNAME=user name export SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_PASSWORD=password export SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_SKIP_SSL_VALIDATION=true export SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_STREAM_STAGING_TIMEOUT=300s export SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_STREAM_STARTUP_TIMEOUT=300s export SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_STREAM_BUILDPACK=java_buildpack_offline export SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_STREAM_MEMORY=512 export SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_TASK_MEMORY=512 export SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_STREAM_ENABLE_RANDOM_APP_NAME_PREFIX=false export SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_STREAM_SERVICES=myMessageStream_rabbitmq_server

SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_STREAM_SERVICES 可以用逗号分隔我们希望与我们的流应用程序绑定的服务实例列表.SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_TASK_SERVICES 用于列出所需的服务绑定到任务应用

SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_STREAM_SERVICES can be a comma separated list of service instances we would like to bind with our stream app. SPRING_CLOUD_DEPLOYER_CLOUDFOUNDRY_TASK_SERVICES for listing desired services to be bound to the task app

  • 启动数据流服务器 -

  • Start Dataflow Server -

    • 如果在本地运行 Stream 应用程序:

    • If running Stream app locally:

    1. 构建数据流服务器本地
      • mvn clean package

  • 如果在 PCF 上运行 Stream 应用程序:

  • If running Stream app on PCF:

    1. 构建数据流服务器CF
      • mvn clean package

  • 构建数据流外壳 - mvn clean package

    启动 DF Shell - mvn spring-boot:run

    Start DF Shell - mvn spring-boot:run

    导入开箱即用的应用程序 - app import --uri use_the_bitly_url_for_stream-applications-rabbit-maven

    Import out of box apps - app import --uri use_the_bitly_url_for_stream-applications-rabbit-maven

    要从本地文件系统导入自定义列表,请使用 Uri 作为文件system: --uri=file://<本地系统jar文件的完整路径>

    For importing the customised list from local file system use Uri for a file system: --uri=file://<full path to the jar file on local system>

  • 注册应用 -

  • Register apps -

    1. app register --name task-processor --type processor --uri maven://org.springframework.cloud.stream.app:tasklaunchrequest-transform-processor-rabbit:jar:1.1.0.BUILD-快照
    2. app register --name task-launcher-local --type sink --uri maven://org.springframework.cloud.stream.app:task-launcher-local-sink-rabbit:jar:1.0.4.发布

  • 创建 &部署流 -

  • Create & Deploy Stream -

    1. 在本地:stream create myMessageStream --definition "rabbit --rabbit.queues=cloud-stream-source --rabbit.requeue=true --spring.rabbitmq.host=localhost --spring.rabbitmq.port=5672 --spring.cloud.stream.bindings.output.contentType='text/plain' | 任务处理器 --uri=maven://com.example:thumbnail-generator:0.0.1-SNAPSHOT | task-launcher-local" --部署

    在 PCF 上:stream create myMessageStream --definition "rabbit --rabbit.queues=cloud-stream-source --rabbit.requeue=true --spring.rabbitmq.host=${vcap.services.p-rabbitmq.credentials.protocols.amqp.host} --spring.rabbitmq.port=${vcap.services.p-rabbitmq.credentials.protocols.amqp.port} --spring.cloud.stream.bindings.output.contentType='text/plain'| task-processor --uri=maven://com.example:thumbnail-generator:0.0.1-SNAPSHOT | task-launcher-local" --deploy

  • 如果成功部署到 PCF,您可以找到 3 个正在运行的应用程序,即.CF 上的 rabbit 侦听器、任务处理器和任务启动器,以启用事件驱动架构微服务.

    As the result in case of a successful deployment to PCF you can find 3 running applications viz. rabbit listener, task processor and task launcher on CF in order to enable the event driven architecture microservices.

    对于作为源的 IBM MQ,流定义将是

    For IBM MQ to be the source, the stream definition would be

    ... --definition "jms --jms.destination=<value>
    --spring.jms.jndi-name=<value> --spring.cloud.stream.bindings.output.contentType='text/plain' ...
    

    值得一提的是,上述所有操作也都可以通过Dataflow Server Dashboard来完成.

    As to mention, all of the above operations can also be completed using the Dataflow Server Dashboard.

    希望能帮到你.

    这篇关于无法在 Spring Cloud Data Flow Pivotal Cloud Foundry 上启动任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    相关文章
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆