spring-batch - Running a spring batch with partitions in cloud foundry
问题描述
I have created an app with spring batch(with partition) application taking example of this https://github.com/mminella/S3JDBC. My app is reading some files from object store and doing some processing and writing back to object the store. My app with local partition works fine in my machine.
I changed the maven, to run in cloud foundry , did change for deployer partition handler and step execution listener and deploying on pcf.
But while trying to push and run the app on pcf , I am getting an issue : Failing URI /v2/info. I tried to log the error found that there is one call to my app e.g https://mypcf.com:443/v2/info and after that it gives the error. I cant provide full logs because of some restrictions. So I want to know :
- To deploy a spring batch in pcf(is there any extra configuration needed except the maven dependency and code changes for deployerpartitionhandler and stepexecutionlistener and @cloudtask): org.springframework.cloud spring-cloud-deployer-cloudfoundry 1.1.0.M1
- Is it mandatory to have a separate data base service like my-sql for the partition job. Cant I use H2(the default one, if I don't configure anything)?
- Do I need to do any configuration in pcf to support running multiple partitions ?
- As I am running remote partitioning , can I run that app on local STS or Intellij(not on PCF-DEV)so that it will run my app in pcf(remote) and launch the workers.(Sorry for the stupid question , I am new to PCF).
解决方案
感谢您查看我的示例。要回答您的问题:
- 您应该能够使用最新的部署器版本(而不是那个相当旧的版本)。
- 是的。分区步骤都需要能够共享相同的作业存储库数据存储,因此像 H2 这样的内存数据库不适用于该用例。
- 除了定义您的数据源之外,这就是在 PCF 中所需要的全部内容。话虽如此,还有其他需要配置的东西,但您可以使用其他机制来执行此操作(Spring Cloud Config Server、application.properties/yml 等)。
- 是的,如果您使用 CF 部署程序,您应该能够在本地运行主服务器并将工作人员部署到 PCF 上。
推荐阅读
- python - pandas:如何总结大小不等的数据集?
- java - 通过代理减慢redis
- c - 为什么用数字位置的概念编写的数字 c 程序的反转而不是像我发布的下面的那样?
- http - 用于 rust 的同步 http 客户端?
- javascript - ajax请求后未定义的Javascript对象属性
- sapui5 - SAPUI5 sap m table 动态列和绑定在视图中的项目
- python - 如何改进这个正则表达式以在其他情况下工作?
- ngrok - 如何使用 ngrok 链接与 ngrok 标准?
- amazon-web-services - 使用 boto3 从 Python lambda 调用 S3 同步
- netlogo - 如何从同一链接的另一个节点复制链接的一个节点的属性?