Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Red Hat OpenShift是一个容器应用程序平台,将DockerKubernetes引入企业。OpenShift Online是一个公共的平台即服务(PaaS),在云中提供托管解决方案。借助OpenShift Online,您可以快速构建,托管和扩展由Red Hat运营和支持的公共云中的集装箱化应用程序。

作为开源的低代码平台,可视化地为编程人员和非编码人员构建企业网络应用程序,Joget Workflow是OpenShift的一个很好的补充。

Image Added

Info

OpenShift Online提供免费的Starter计划,因此您可以免费使用它进行学习和实验。


在本例中,我们将在一个完整的开源堆栈上部署Joget工作流,其中包括Red Hat JBoss WildFly应用服务器和Linux上的MySQL数据库。WildFly,前身为JBoss,是一个领先的轻量级应用服务器,MySQL是当今最流行的开放源码数据库。


步骤1:在线注册OpenShift

https://manage.openshift.com/免费注册并选择所需的计划和地区。

Image Added

Image Added

Image Added

Image Added

第2步:创建OpenShift项目

OpenShift Web控制台中,使用“ 创建项目” 按钮创建一个项目,并键入所需的名称,显示名称和说明。

Image Added

第3步:部署MySQL数据库

在所选项目下,选择添加到项目>浏览目录并选择MySQL(持久性)图像。

Image Added

键入适当的设置并单击Create。

 

内存限制

200Mi(此值适用于将总内存限制为1GB的OpenShift Starter计划)

数据库服务名称

jogetdb

MySQL连接用户名

joget

MySQL连接密码

joget

MySQL数据库名称

jwdb

 

Image Added

Image Added


步骤4:在JBoss WildFly应用服务器上部署Joget工作流。

在选定的项目下,选择Add to project > Deploy Image,在jogetworkflow/jboss-joget-enterprise中选择Image Name选项和key。点击这个小的搜索图标来载入在Docker中心托管的合适的Docker镜像。

Image Added

添加环境变量以匹配之前配置的MySQL容器的数据库设置,并单击Deploy。

 

MYSQL_HOST

jogetdb

MYSQL_PORT

3306

MYSQL_DATABASE

jwdb

MYSQL_USER

joget

MYSQL_PASSWORD

joget

 

Image Added

Image Added

默认情况下,创建的pod(一个pod是一个或多个容器的组)只分配了512Mb的内存,所以我们需要分配更多的资源以避免内存错误。

点击Applications> Deployments,然后选择jboss-joget-enterprise 容器。单击向下箭头,将运行的窗格减少到零。

Image Added

选择 操作>编辑资源限制,将内存限制设置800兆,然后单击保存

Image Added

返回应用程序>部署,并选择最新的jboss-joget-enterprise版本。通过点击向上箭头,将运行的pod调整为一个。此时,一个新的pod将启动,状态应该更改为Active。

Image Added

单击pod查看pod详细信息。

Image Added

您还可以通过logs选项卡查看pod的运行日志。

Image Added


步骤5:为外部访问创建服务路由。

此时,pod正在运行,但无法从外部web浏览器访问,因此您需要创建一条路由,该路由以主机名公开服务。

 

单击应用程序>服务并选择jboss-joget-enterprise。

Image Added

选择 操作>创建路线,然后点击创建

Image Added

就是这样。点击主机名链接访问应用程序。

Image Added

例如,在上面的截图中,URL http://jboss-joget-enterprise joget.8188.starter-us-west-2.openshiftapps.com/返回WildFly欢迎页。

Image Added

通过在URL中添加/jw来访问Joget工作流,例如http://jboss- Joget -enterprise joget.8188.starter-us-west-2.openshiftapps.com/jw。

 

Image Added

OpenShift Online (www.openshift.com) is an application hosting platform by Red Hat (www.redhat.com) that makes it easy to run container-based web applications in the cloud. As an open source platform to easily build enterprise web apps for cloud and mobile, Joget Workflow (www.joget.org) is a good complement for OpenShift.

Info

OpenShift Online has a free monthly plan that allows you to host up to 3 web applications in the cloud for free. As such, you can run a basic Joget Workflow deployment without any cost!

This article describes the steps required to deploy Joget Workflow on OpenShift Online using an Ubuntu Linux client. Just follow the steps below and you can get a running Joget Workflow installation very quickly. You can also manage OpenShift using other OS platforms (e.g. Windows, OSX, etc) by adapting the commands accordingly.

Step 1: Signup for OpenShift

Sign up for free at https://www.openshift.com/app/account/new and follow the instructions

Image Removed

Step 2: Install Prerequisites i.e. Git, Ruby and OpenShift Client Tools

Run the following commands in your Ubuntu client to install the prerequisite tools to manage OpenShift applications:

Code Block
languagebash
# install git and ruby
echo === Install Git and Ruby ===
sudo apt-get install git ruby

# install openshift client tools
echo === Install OpenShift Client Tools ===
sudo gem install rhc

# run openshift setup
echo === Run OpenShift Setup ===
rhc setup

Step 3: Create OpenShift App and Deploy Joget Workflow

Run the following script in your Ubuntu client to create an OpenShift application and install Joget Workflow v5 Enterprise Edition:

Code Block
languagebash
export JOGET_VERSION=5.0.1
export APP_NAME=joget5

echo === Create OpenShift Tomcat MySQL App ===
rhc app-create $APP_NAME tomcat7 mysql-5.5 phpmyadmin

echo === Configure Java VM and Environment Variables ===
export OPENSHIFT_DATA_DIR=$(rhc ssh $APP_NAME 'echo $OPENSHIFT_DATA_DIR');\
rhc env-set JAVA_OPTS_EXT="-Djava.awt.headless=true -Dwflow.home=${OPENSHIFT_DATA_DIR}wflow/" --app $APP_NAME;\
export OPENSHIFT_MYSQL_DB_HOST=$(rhc ssh $APP_NAME 'echo $OPENSHIFT_MYSQL_DB_HOST');\
export OPENSHIFT_MYSQL_DB_USERNAME=$(rhc ssh $APP_NAME 'echo $OPENSHIFT_MYSQL_DB_USERNAME');\
export OPENSHIFT_MYSQL_DB_PASSWORD=$(rhc ssh $APP_NAME 'echo $OPENSHIFT_MYSQL_DB_PASSWORD');\
export OPENSHIFT_DATA_DIR=$(rhc ssh $APP_NAME 'echo $OPENSHIFT_DATA_DIR')

echo === Restart OpenShift App ===
rhc app restart $APP_NAME

echo === Deploy Joget Workflow $JOGET_VERSION ===
rhc ssh $APP_NAME "cd ~/app-root/data;\
echo '--- Download Bundle ---';\
wget http://dev.joget.org/downloads/enterprise/joget-enterprise-linux-$JOGET_VERSION.tar.gz;\
echo '--- Extract Bundle ---';\
tar xvfz joget-enterprise-linux-$JOGET_VERSION.tar.gz;\
cd joget-enterprise-linux-$JOGET_VERSION;\
echo '--- Setup Datasource ---';\
apache-ant-1.7.1/bin/ant setup -Dprofile.name=default -Ddb.name=jwdb -Ddb.host=$OPENSHIFT_MYSQL_DB_HOST -Ddb.port=3306 -Ddb.user=$OPENSHIFT_MYSQL_DB_USERNAME -Ddb.password=$OPENSHIFT_MYSQL_DB_PASSWORD;\
cp -rf wflow/ $OPENSHIFT_DATA_DIR/;\
echo '--- Setup WARs ---';\
mv apache-tomcat-8.0.20/webapps/jw* ~/jbossews/webapps/;\
echo '--- Clean Bundle ---';\
cd ..;\
rm -r joget-enterprise-linux-*"

Step 4: Access Joget Workflow installation

Deployment may take some time so be patient, check the OpenShift app logs using:

Code Block
languagebash
rhc tail -a $APP_NAME

Once the deployment is complete, browse to your Joget Workflow installation at http://joget5-Your_OpenShift_Account.rhcloud.com/jw