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=${1:-scdf}
version=${2:-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=0;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.创建任务

  • 启动客户端
[[email protected] ~]# java -jar spring-cloud-dataflow-shell-1.2.3.RELEASE.jar
  ____                              ____ _                __
 / ___| _ __  _ __(_)_ __   __ _   / ___| | ___  _   _  __| |
 \___ \| ‘_ \| ‘__| | ‘_ \ / _` | | |   | |/ _ \| | | |/ _` |
  ___) | |_) | |  | | | | | (_| | | |___| | (_) | |_| | (_| |
 |____/| .__/|_|  |_|_| |_|\__, |  \____|_|\___/ \__,_|\__,_|
  ____ |_|    _          __|___/                 __________
 |  _ \  __ _| |_ __ _  |  ___| | _____      __  \ \ \ \ \  | | | |/ _` | __/ _` | | |_  | |/ _ \ \ /\ / /   \ \ \ \ \  | |_| | (_| | || (_| | |  _| | | (_) \ V  V /    / / / / / /
 |____/ \__,_|\__\__,_| |_|   |_|\___/ \_/\_/    /_/_/_/_/_/

1.2.3.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

因为只用到一个任务,所以先修改

[[email protected] ~]# cat timestamp1.task
task.timestamp=docker:docker-registry.default.svc:5000/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

原文地址:https://www.cnblogs.com/ericnie/p/10050464.html

时间: 2024-07-30 01:35:58

Spring Dataflow批处理框架在OCP上的部署的相关文章

图书简介:Spring Batch批处理框架

大数据时代批处理利器,国内首度原创解析Spring Batch框架. 内容简介: <Spring Batch 批处理框架>全面.系统地介绍了批处理框架Spring Batch,通过详尽的实战示例向读者展示了Spring Batch框架对大数据批处理的基本开发能力,并对框架的架构设计.源码做了特定的剖析:在帮助读者掌握Spring Batch框架基本功能.高级功能的同时,深入剖析了Spring Batch框架的设计原理,帮助读者可以游刃有余地掌握Spring Batch框架. <Sprin

万树IT:Spring Batch批处理框架技巧,让你不再重复造轮子

整理了Spring批处理框架的内容,掌握这些知识,可以帮你省去一些造轮子的过程,提高开发效率.本文由博主姚兆峰分享,小编整理后推送,希望对你的工作有帮助. Part.1 问题分析 在大型的企业应用中,或多或少都会存在大量的任务需要处理,如邮件批量通知所有将要过期的会员等等.而在批量处理任务的过程中,又需要注意很多细节,如任务异常.性能瓶颈等等.那么,使用一款优秀的框架总比我们自己重复地造轮子要好得多一些. AD 我所在的物联网云平台部门就有这么一个需求,需要实现批量下发命令给百万设备.为了防止枯

基于spring 3.0mvc 框架的文件上传实现

Spring 框架提供了构建 Web 应用程序的全功能 MVC 模块.使用 Spring 可插入的 MVC 架构,可以选择是使用内置的 Spring Web 框架还是 Struts 这样的 Web 框架.通过策略接口,Spring 框架是高度可配置的,而且包含多种视图技术,例如 JavaServer Pages(JSP)技术.Velocity.Tiles.iText 和 POI.Spring MVC 框架并不知道使用的视图,所以不会强迫您只使用 JSP 技术.Spring MVC 分离了控制器.

使用Spring Batch批处理框架(参考)

本文主要介绍了春季批量框架的使用分析.文章通过实例代码详细介绍,对每个人的学习或工作都有一定的参考和学习价值,需要的朋友可以参考. 使用春季批处理作为批处理框架,可以在常规数据量不是特别大的情况下完成离线计算. 现在写一个简单的入门级例子.http://m.jlnk3659999.com 这里的默认设置是每个人都已经掌握了Spring Batch的基本知识,这个例子只是为了快速实现手. 目标1:程序随机生成字符串,在春季批处理后,在字符串后统一添加“-processed”,并输出它们 目标2:程

【转】大数据批处理框架 Spring Batch全面解析

如今微服务架构讨论的如火如荼.但在企业架构里除了大量的OLTP交易外,还存在海量的批处理交易.在诸如银行的金融机构中,每天有3-4万笔的批处理作业需要处理.针对OLTP,业界有大量的开源框架.优秀的架构设计给予支撑:但批处理领域的框架确凤毛麟角.是时候和我们一起来了解下批处理的世界哪些优秀的框架和设计了,今天我将以Spring Batch为例,和大家一起探秘批处理的世界.初识批处理典型场景探秘领域模型及关键架构实现作业健壮性与扩展性批处理框架的不足与增强批处理典型业务场景对账是典型的批处理业务处

走进企业级批处理框架--Springbatch

Springbatch是一个轻量级的,完全面向Spring的批处理框架,可以应用于企业级大量的数据处理系统.Spring Batch可以提供大量的,可重复的数据处理功能,包括日志记录/跟踪,事务管理,作业处理统计工作重新启动.跳过,和资源管理等重要功能.它能使业务人员专注于核心业务的开发,而将重复性的耗时工作交给系统自动处理.如数据的倒入,导出,数据的复制等工作.本文将通过一个简单的文件复制的小例子介绍SpringBatch的工作原理.首先来看相关的核心代码和配置: <?xml version=

关于我使用spring mvc框架做文件上传时遇到的问题

非常感谢作者 原文:https://blog.csdn.net/lingirl/article/details/1714806 昨天尝试着用spring mvc框架做文件上传,犯了挺多不该犯的毛病问题1:org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.ClassCastException: org.apache.catalin

异步并行批处理框架设计的一些思考(转)

随着互联网信息技术日新月异的发展,一个海量数据爆炸的时代已经到来.如何有效地处理.分析这些海量的数据资源,成为各大技术厂商争在激烈的竞争中脱颖而出的一个利器.可以说,如果不能很好的快速处理分析这些海量的数据资源,将很快被市场无情地所淘汰.当然,处理分析这些海量数据目前可以借鉴的方案有很多:首先,在分布式计算方面有Hadoop里面的MapReduce并行计算框架,它主要针对的是离线的数据挖掘分析.此外还有针对实时在线流式数据处理方面的,同样也是分布式的计算框架Storm,也能很好的满足数据实时性分

Spring的JDBC框架

转自: http://www.cnblogs.com/windlaughing/p/3287750.html Spring JDBC提供了一套JDBC抽象框架,用于简化JDBC开发. Spring主要提供JDBC模板方式.关系数据库对象化方式.SimpleJdbc方式.事务管理来简化JDBC编程 Spring提供了3个模板类: JdbcTemplate:Spring里最基本的JDBC模板,利用JDBC和简单的索引参数查询提供对数据库的简单访问. NamedParameterJdbcTemplat