Spring Dataflow批处理框架在OCP上的部署
详细参考
https://donovanmuller.blog/spring-cloud-dataflow-server-openshift/docs/1.2.1.RELEASE/reference/htmlsingle/
注意事项:
- Openshift上需要部署service catalog
部署步骤
1.建立项目
#oc login -u admin
#oc new-project scdf --description="Spring Cloud Data Flow"
2.部署模板
官方材料一般都有问题
curl https://raw.githubusercontent.com/donovanmuller/spring-cloud-dataflow-server-openshift/v1.2.1.RELEASE/src/etc/openshift/install-templates.sh | bash
我的做法是,把install-templates.sh下载下来,然后按照sh脚本步骤一步一步部署
#!/usr/bin/env bash # This script downloads the Data Flow Server for OpenShift templates and uploads them into
# a specified project. The default project is `scdf` as per the Getting Started guide from the reference
# documentation. However, the project can be specified as the first argument to this script.
#
# Usage:
#
# $ ./install-templates.sh [project name]
#
# or alternatively:
#
# $ curl -sL https://github.com/donovanmuller/spring-cloud-dataflow-server-openshift/releases/download/${version}/scdf-openshift-templates.zip \
# | bash -s [project name] [tag/branch]
# project=${:-scdf}
version=${:-v1.1.0.RELEASE} echo "Installing OpenShift templates (${version}) into project '${project}'..." curl -o /tmp/scdf-openshift-templates.zip -sL https://github.com/donovanmuller/spring-cloud-dataflow-server-openshift/releases/download/${version}/scdf-openshift-templates.zip
unzip -o /tmp/scdf-openshift-templates.zip -d /tmp/scdf-openshift-templates shopt -s nullglob
for template in /tmp/scdf-openshift-templates/*.yaml
do
echo "Installing template '$template'"
oc replace --force=true -f $template
done echo "Adding 'edit' role to 'scdf' Service Account..." oc policy add-role-to-user edit system:serviceaccount:${project}:scdf echo "Adding 'scdf' Service Account to the 'anyuid' SCC..." oc adm policy add-scc-to-user anyuid system:serviceaccount:${project}:scdf echo "Templates installed."
一看,说白了也就部署一堆templates,因为涉及到好几个镜像,可以按照pullimage.sh文件提供的镜像预先下载
#!/usr/bin/env bash echo "Pulling images..." declare -a images=(
"mysql:5.6"
"redis:3-alpine"
"donovanmuller/spring-cloud-dataflow-server-openshift:1.2.0.RELEASE"
"rabbitmq:3-management"
"digitalwonderland/zookeeper"
"wurstmeister/kafka:0.10.2.1"
) for((i=;i<${#images[@]};i++))
do
echo "Pulling '${images[$i]}' - `expr $i + 1` of ${#images[@]}"
docker pull ${images[$i]}
done
因为我的OCP是个离线环境,因此下载完后push到本地的 registry

修改我们要用到的scdf-ephemeral-datasources-kafka-template.yaml,然后oc create -f,可以在catalog中看到

3.创建实例
保证pod启动

那个metrics因为没有下载镜像,所以无法启动,暂时不理。
访问
http://scdf-kafka-scdf.apps.example.com/dashboard/index.html#/apps/apps 出现主界面

授权
oc create -f scdf-sa.yaml
oc policy add-role-to-user edit system:serviceaccount:scdf:scdf
oc adm policy add-scc-to-user anyuid system:serviceaccount:scdf:scdf
4.创建任务
- 启动客户端
[root@master ~]# java -jar spring-cloud-dataflow-shell-1.2..RELEASE.jar
____ ____ _ __
/ ___| _ __ _ __(_)_ __ __ _ / ___| | ___ _ _ __| |
\___ \| '_ \| '__| | '_ \ / _` | | | | |/ _ \| | | |/ _` |
___) | |_) | | | | | | | (_| | | |___| | (_) | |_| | (_| |
|____/| .__/|_| |_|_| |_|\__, | \____|_|\___/ \__,_|\__,_|
____ |_| _ __|___/ __________
| _ \ __ _| |_ __ _ | ___| | _____ __ \ \ \ \ \ \
| | | |/ _` | __/ _` | | |_ | |/ _ \ \ /\ / / \ \ \ \ \ \
| |_| | (_| | || (_| | | _| | | (_) \ V V / / / / / / /
|____/ \__,_|\__\__,_| |_| |_|\___/ \_/\_/ /_/_/_/_/_/ 1.2..RELEASE Welcome to the Spring Cloud Data Flow shell. For assistance hit TAB or type "help".
server-unknown:>
server-unknown:>dataflow config server --uri http://scdf-kafka-scdf.apps.example.com --username user --password password
Successfully targeted http://scdf-kafka-scdf.apps.example.com
这里注意要用user/password连上,用admin/welcome1是有问题的。
- 注册任务
按照官方文档,又是有问题的,后来自己下载下来然后用文件方式导入
dataflow:>app import --uri http://bit.ly/1-0-1-GA-task-applications-maven
因为只用到一个任务,所以先修改
[root@master ~]# cat timestamp1.task
task.timestamp=docker:docker-registry.default.svc:/scdf/timestamp-task:latest
导入
dataflow:>app import --uri file:////root/timestamp1.task
Successfully registered applications: [task.timestamp]
- 创建任务并运行
dataflow:>task create task1 --definition "timestamp"
Created new task 'task1'
dataflow:>task launch task1
Launched task 'task1'
在界面上看到一个task

在ocp console上也看到这些task1的pod

Spring Dataflow批处理框架在OCP上的部署的更多相关文章
- Spring Batch 批处理框架介绍
前言 在大型的企业应用中,或多或少都会存在大量的任务需要处理,如邮件批量通知所有将要过期的会员,日终更新订单信息等.而在批量处理任务的过程中,又需要注意很多细节,如任务异常.性能瓶颈等等.那么,使用一 ...
- Spring Batch 批处理框架
<Spring Batch 批处理框架>基本信息作者: 刘相 出版社:电子工业出版社ISBN:9787121252419上架时间:2015-1-24出版日期:2015 年2月开本:16开页 ...
- 图书简介:Spring Batch批处理框架
大数据时代批处理利器,国内首度原创解析Spring Batch框架. 内容简介: <Spring Batch 批处理框架>全面.系统地介绍了批处理框架Spring Batch,通过详尽的实 ...
- spring batch批处理框架学习
内如主要来自以下链接: http://www.importnew.com/26177.html http://www.infoq.com/cn/articles/analysis-of-large-d ...
- 基于spring 3.0mvc 框架的文件上传实现
Spring 框架提供了构建 Web 应用程序的全功能 MVC 模块.使用 Spring 可插入的 MVC 架构,可以选择是使用内置的 Spring Web 框架还是 Struts 这样的 Web 框 ...
- 【转】大数据批处理框架 Spring Batch全面解析
如今微服务架构讨论的如火如荼.但在企业架构里除了大量的OLTP交易外,还存在海量的批处理交易.在诸如银行的金融机构中,每天有3-4万笔的批处理作业需要处理.针对OLTP,业界有大量的开源框架.优秀的架 ...
- spring-batch批处理框架
转自 http://www.cnblogs.com/gulvzhe/archive/2011/10/21/2220260.html 这个框架没有实际操作,只是从同事处学习到,先转个好文章,以后有机会再 ...
- 通过例子讲解Spring Batch入门,优秀的批处理框架
1 前言 欢迎访问南瓜慢说 www.pkslow.com获取更多精彩文章! Spring相关文章:Springboot-Cloud相关 Spring Batch是一个轻量级的.完善的批处理框架,作为S ...
- (文件)图片上传,Spring或SpringMVC框架
spring或springMVC框架图片(文件)上传 页面部分,用一个简单的form表单提交文件,将图片或文件提交到服务端.一个输入框,用于输入图片的最终名称,一个file文件选择,用于选择图片. 页 ...
随机推荐
- Python中使用dom模块生成XML文件示例
在Python中解析XML文件也有Dom和Sax两种方式,这里先介绍如何是使用Dom解析XML,这一篇文章是Dom生成XML文件,下一篇文章再继续介绍Dom解析XML文件. 在生成XML文件中,我们主 ...
- HDU-1151
Air Raid Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Su ...
- Python 邮件发送消息
# 代码 #!/usr/bin/env python # -*- coding:utf-8 -*- # Author:supery import smtplib from email.mime.tex ...
- Longest Palindromic Substring (最长回文字符串)——两种方法还没看,仍需认真看看
Given a string S, find the longest palindromic substring in S. You may assume that the maximum lengt ...
- 数据库之存储过程(Stored Procedure)【未完待续】
存储过程(Stored Procedure,以下简称SP)是啥?有什么用?优缺点? 一个SP是一段存储在数据库系统中的一条或多条sql语句的集合,类似一条批处理,它能被触发器,或者其他的SP以及APP ...
- Nodejs Mocha测试学习
参考大神阮一峰的文章<测试框架 Mocha 实例教程> 目前在使用Nodejs,但写完的程序很容易出错,那怎么办?需要引入单元测试去做基础的测试 目前Nodejs用来做单元测试的工具接触的 ...
- java File类 打印目录树状结构(递归)
import java.io.File; /** * 递归遍历 * */ public class FieTree { public static void main(String[] args) { ...
- React Hooks useState为什么顺序很重要
一个Function Component的state状态整体是作为memoizedState存在FIber中的. function执行时,首先取memoizedState第一个base state,作 ...
- es6 Object的几个新方法
扩展对象 Object.preventExtensions Object.isExtensible 密封对象 Object.seal Object.isSealed 冻结对象 Object.freez ...
- Shiro过滤器的维护与匹配执行
servlet的初始化会触发核心过滤器的创建: public Object getObject() throws Exception { if (instance == null) { instanc ...