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文件选择,用于选择图片. 页 ...
随机推荐
- [New learn] 手势
1.简介 我们经常会在设备上查看图片等, 也会经常将图片通过手指的捏合打开来缩小和方法图片.这就是ios中的手势功能在起作用. 那么手势好像也是一种touch事件,那和UIResponder中定义的t ...
- hihocoder 1177 : 顺子
#1177 : 顺子 时间限制:6000ms 单点时限:1000ms 内存限制:256MB 描述 你在赌场里玩梭哈,已经被发了4张牌,现在你想要知道发下一张牌后你得到顺子的概率是多少? 假定赌场使用的 ...
- 【转载】PDB命令行调试Python代码
转载自这里. (博主按:PDB调试python代码和用GDB调试c++代码很类似) 你有多少次陷入不得不更改别人代码的境地?如果你是一个开发团队的一员,那么你遇到上述境地的次数比你想要的还要多.然而, ...
- 使用JavaScript实现长方形、直角三角形、平行四边形、等腰三角形、倒三角、数字三角形
[循环嵌套的规律] 1.外层循环控制行数,内层循环控制每行中元素的个数. [图形题思路] 1.确定图形有几行,行数即为外层循环次数: 2.确定每行中有几种元素组成,有几种元素表示有几 ...
- BC-NFS部署报错节点间磁盘wwid冲突
1.在部署公司的BC-NFS产品时,填好IP选好磁盘后,点击“创建”,就抛出如下提示: 2.关闭虚机,再打开虚机的控制台,点击磁盘,自定义serial number 3.启动虚机,再次登陆,查看磁盘w ...
- 微软企业库5.0 学习之路——第二步、使用VS2010+Data Access模块建立多数据库项目
现在我就开始进入学习之路的第二步——Data Access模块,这个模块是企业库中被使用频率最高的模块,它很好的封装了数据库操作应用,为我们进行多数据库系统开发提供了便利,只需更改配置文件就 可以很快 ...
- MySQL常用的数学函数
在使用mysql自带的函数要慎重,说是会影响数据执行效率,代价太大.这个也要区分开,区分快软件的引用范畴,比如说内部系统业务逻辑比较复杂,功能点很细,但是并发量不是很大,这个时候用MySQL自带的函数 ...
- Mybatis框架-2
1.Mybatis中的接口形式 在Mybatis中使用接口形式将通过代理对象调用方法,从而实现sql的执行 1)定义一个接口 package mapper; import java.util.List ...
- Aras Innovator 11 sp2安装
本文档记录Aras Innovator 11 sp2的安装过程 官方安装文档:http://www.aras.com/support/documentation/ Aras Innovator 11. ...
- 架构设计之NodeJS操作消息队列RabbitMQ
一. 什么是消息队列? 消息(Message)是指在应用间传送的数据.消息可以非常简单,比如只包含文本字符串,也可以更复杂,可能包含嵌入对象. 消息队列(Message Queue)是一种应用间的通信 ...