Versions Compared

Key

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

Table of Contents
indent30px
stylecircle

...

介绍

Overview

概观

本文旨在描述在集群环境中部署This document is intended to describe the steps required to deploy Joget Workflow Large Enterprise Edition (LEE) in a clustered environment for scalability and redundancy.

Requirements

In order for clustering to work, the Large Enterprise Edition is required. The standard Enterprise Edition will not work due to licensing restrictions. Clustering requires several layers to be prepared and configured:

  • Load Balancers
  • Application Servers
  • Shared File Directory
  • Shared Database

Architecture

There are many ways to design the clustering architecture, but the core concepts will be similar. In this document, the architecture used is as follows:
Image Removed

Deployment and Configuration Guide

This guide describes the steps required to setup Joget Workflow LEE clustering. The exact steps will depend on the actual products used in each layer.

 

Warning
IMPORTANT: Please note that there is minimal configuration required in Joget Workflow LEE itself, and almost all the work is done on the separate layers so it is vital to ensure that you have sufficient expertise in your chosen products.

...

Edition(LEE)以实现可伸缩性和冗余性所需的步骤。

要求

为了使群集起作用,需要大型企业版。由于许可限制,标准企业版将不起作用。集群需要准备和配置几个层:

  • 负载平衡器
  • 应用服务器
  • 共享文件目录
  • 共享数据库

架构

设计集群架构的方法有很多,但核心概念是相似的。在本文档中,使用的架构如下所示:

Image Added

部署和配置指南

本指南介绍了安装Joget Workflow LEE集群所需的步骤。确切的步骤将取决于每层中使用的实际产品。

 

Warning

重要提示:请注意,Joget Workflow LEE本身需要很少的配置,几乎所有的工作都是在单独的层上完成的,因此确保您在所选产品中拥有足够的专业知识至关重要。


预部署要求

在可以完成集群安装之前,需要以下先决条件:

共享文件目录

公用目录由具有读/写权限的应用程序服务器访问。该目录用于存储共享配置文件,系统生成的文件和上传的文件。验证共享目录是否安装在应用程序服务器上,并且可以通过读取和写入权限访问文件。

共享数据库

公用数据库由具有选择,更新,删除,创建和更改表的权限的应用程序服务器访问。验证应用程序服务器是否可以连接和查询共享数据库。

应用服务器

Java Web应用程序服务器将在群集中的每个服务器上安装并运行。验证每个应用程序服务器是否已正确安装,并且可以通过Web浏览器进行访问。

会话复制

会话复制要在应用程序服务器和网络上配置。验证是否为每个应用程序服务器和网络配置了会话复制。

负载平衡器

要安装和配置负载平衡器(硬件或软件),以便将以/ jw开头的请求的流量导向应用程序服务器。验证是否已正确安装并配置了负载平衡器,以便将Web流量导向到各个应用程序服务器。


 

Joget工作流集群配置

确保预部署要求已得到验证,这一点非常重要。一旦通过验证,Joget Workflow的具体步骤如下:

数据源配置

在共享目录中配置数据源属性文件

  1. 将文件app_datasource.properties

...

Before the clustering installation can be done, the following prerequisites are needed:

Shared file directory

Common directory to be accessed by the application servers with read/write permissions. This directory is used to store shared configuration files, system generated files, and uploaded files. Verify that the shared directory is mounted on the application servers and that files can be accessed with read and write permissions.

Shared database

Common database to be accessed by the application servers with permission to select, update, delete, create and alter tables. Verify that the application servers can connect and query the shared database.

Application servers

Java web application server to be installed and running on each server in the cluster. Verify that each application server has been installed correctly and can be accessed with a web browser.

Session replication

Session replication to be configured on the application servers and network. Verify that session replication has been configured for each application server and the network.

Load balancer

Load balancer (hardware or software) to be installed and configured to direct traffic for requests beginning with /jw to the application servers. Verify that the load balancer has been installed and configured correctly so that web traffic is directed to the individual application servers.

 

Joget Workflow Clustering Configuration

It is important to ensure that the pre-deployment requirements have been verified. Once verified, the Joget Workflow specific steps are as follows:

Datasource Configuration

Configure the datasource properties files in the shared directory

  1. Copy the files app_datasource.properties and app_datasource-default.properties from the wflow directory of a standard Joget installation into the shared file directory.从标准Joget安装的wflow目录复制到共享文件目录中。
  2. 编辑Edit app_datasource-default.properties and set the database connection settings for the shared database, e.g. for MySQL, change the bold values below:并设置共享数据库(例如MySQL)的数据库连接设置,更改下面的粗体值:

 

Code Block
workflowDriver=com.mysql.jdbc.DriverworkflowUrl=jdbc\:mysql\://host\:port/database_name?characterEncoding\=UTF-8
workflowUser=usernameusername 
profileName= 
workflowPassword=password

Application Deployment and Configuration

Deploy Joget WAR files to the application servers and configure the startup properties to point to the shared directory.

应用程序部署和配置

将Joget WAR文件部署到应用程序服务器,并将启动属性配置为指向共享目录。

  1. 将WAR文件Deploy the WAR files jw.war and jwdesigner.war from the LEE bundle to each of the application servers e.g. for Apache Tomcat, copy the files into the tomcat webapps directory从LEE包中部署到每个应用服务器,例如Apache Tomcat,将这些文件复制到tomcat webapps目录
  2. 在应用程序服务器启动中添加Java Add a Java -wflow.home = shared_directory_path option in the application server startup e.g. for Apache Tomcat, modify the JAVA_OPTS line选项,例如,对于Apache Tomcat,请修改JAVA_OPTS行

 

Code Block
export JAVA_OPTS ="-XX:MaxPermSize=“ - XX:MaxPermSize = 128m -Xmx1024M -Dwflow.home = / shared_directory_path"path”

License Activation

Activate license for each server. Each server has a unique system key and requires a separate license activation.


许可证激活

激活每个服务器的许可证。每台服务器都有一个唯一的系统密钥,需要单独的许可证激活。

  1. 对于每个应用程序服务器,使用浏览器直接访问Joget Web控制台,绕过负载平衡器,例如{+} http:// server1:8080 For each of the application servers, use the browser to directly access the Joget web console bypassing the load balancer e.g. {+}http://server1:8080 / jw / web / console / home +Request for license and activate it using the link in the web console footer.

Post-Deployment Testing

Once the pre-deployment and clustering configuration has been done, the testing is a matter of using a web browser to access the load balancer.

 

Sample Installation and Configuration

 

This sample describes an installation using the following products:

  1. 请求许可证并使用的Web控制台页脚中的链接激活它。

部署后测试

一旦完成了预部署和集群配置,测试就是使用的Web浏览器访问负载平衡器。

 

示例安装和配置

 

本示例介绍使用以下产品进行的安装:

Joget工作流程Joget Workflow

Joget Workflow v5 LEE

Load Balancer负载平衡器

Apache HTTP Web Server 2.4 with mod_proxy and mod_balancer (proxy and load balancing modules) running on Ubuntu 14.04

Application Servers

Apache Tomcat 8.0 running on Ubuntu 14.04

Shared File Directory

NFS on Ubuntu 14.04

Shared Database

MySQL 5.5 on Ubuntu 14.04

Warning
IMPORTANT: Please note that this is not a comprehensive guide and does not cover production-level requirements e.g. user permissions, network and database security, etc. Please ensure that these are covered by your system, network and database administrators.

Create a Shared File Directory

Share a file directory to be accessed by the application servers. This directory is used to store configuration files, system generated files, and uploaded files.
In this sample, the shared file directory will be a directory /export/wflow in the file server

Web服务器2.4与在Ubuntu 14.04上运行的mod_proxy和mod_balancer(代理和负载平衡模块)

应用服务器

运行在Ubuntu 14.04上的Apache Tomcat 8.0

共享文件目录

NFS 14.04上的NFS

共享数据库

Ubuntu 14.04上的MySQL 5.5

Warning
重要说明:请注意,这不是一个全面的指南,不包括生产级别的要求,例如用户权限,网络和数据库安全性等。请确保这些要求由系统,网络和数据库管理员负责。

创建一个共享文件目录

共享应用程序服务器要访问的文件目录。该目录用于存储配置文件,系统生成的文件和上传的文件。
在此示例中,共享文件目录将是文件服务器中的目录/ export / wflow 

在文件服务器中,安装NFS服务器In the file server, install the NFS server

Code Block
sudo apt-get install portmap nfs-kernel-server

创建共享目录并设置权限Create shared directory and set permission

Code Block
sudo mkdir -p /export/wflow
sudo chown nobody:nogroup /export/wflow

Configure NFS to export the shared directory, edit 配置NFS导出共享目录,编辑/ etc / exports to export the directory to the local 192将目录导出到本地192.168.1.0 subnetwork with your favourite editor0子网中

Code Block
sudo vim /etc/exports 

The /etc/exports should contain the following:应包含以下内容:

Code Block
/export/wflow 192.168.1.0/255.255.255.0(rw,no_subtree_check,async)

导出共享并重新启动NFS服务Export the shares and restart NFS service

Code Block
sudo exportfs -ra
sudo service nfs-kernel-server restart 

 

Mount the Shared Directory in the Application Servers

将共享目录挂载到应用程序服务器中

在应用程序服务器中,安装NFS客户端In the application servers, install the NFS client

Code Block
apt-get install nfs-common
 

Create new directory 创建新目录/ opt / joget / shared / wflow to mount the shared directory and set the directory permissions来挂载共享目录并设置目录权限

Code Block
sudo mkdir -p /opt/joget/shared/wflow
sudo chmod 777 /opt/joget/shared/wflowwflow 

Mount the shared directory.安装共享目录。

Code Block
sudo mount -t nfs wflow:/export/wflow /opt/joget/shared/wflow
 

测试读写权限以确认目录共享是否有效。Test read-write permissions to confirm that the directory sharing works.

Code Block
echo test123 > /opt/joget/shared/wflow/test.txt

Create a Shared Database

创建一个共享数据库

安装MySQL(Install MySQL (https://help.ubuntu.com/14.04/serverguide/mysql.html)

Code Block
sudo apt-get install mysql-server
 

创建一个名为jwedb的应用程序服务器可访问的数据库Create a database called jwedb accessible to the application servers.

Code Block
mysql -u root 

运行以下MySQL命令来创建一个空白数据库Run the following MySQL commands to create a blank database

Code Block
create database jwedb;
quit

Populate the newly created database with the Joget database schema使用Joget数据库模式填充新创建的数据库

Code Block
mysql -uroot jwedb < /path/to/jwdb-mysql.sql

Configure database permissions配置数据库权限

Code Block
mysql -u root 

运行以下MySQL命令来授予用户joget和密码joget的权限Run the following MySQL commands to grant permissions to user joget and password joget

Code Block
grant all privileges on jwedbjwdb.* to 'joget'@'%' identified by 'joget';
flush privileges;
quit

Configure MySQL to listen to database connections from remote hosts. Edit the my.cnf file with your favourite editor配置MySQL以侦听来自远程主机的数据库连接。用你最喜欢的编辑器编辑my.cnf文件

Code Block
sudo vim /etc/mysql/my.cnf 

Comment away the bind-address directive by adding a # in front of the line通过在行前添加#来注释掉bind-address指令

Code Block
#bind#bind-address = 127.0.0.1 

Restart MySQL重新启动MySQL

Code Block
sudo service mysql restart

In the application server, test a remote connection to the database server 在应用程序服务器中,测试到数据库服务器database_host的远程连接 

Code Block
mysql -h database_host -u joget -p

Deploy Application Servers



部署应用程序服务器

在每个应用程序服务器上安装Apache Tomcat。在每个应用程序服务器中,运行以下命令将tomcat解压缩到Install Apache Tomcat on each of the application servers. In each application server, run the following to extract tomcat into / opt / joget:joget中:

Code Block
sudo mkdir -p /opt/joget/
sudo tar xvfz apache-tomcat-8.0.20.tar.gz /opt/joget/

Start each application server启动每个应用服务器

Code Block
sudo cd /opt/joget/apache-tomcat-8.0.20
sudo ./bin/catalina.sh start

Open a web browser and access each server to confirm that 打开Web浏览器并访问每个服务器以确认http://server:8080/jw

 

 

Configure Application Server Session Replication

配置应用服务器会话复制

通过编辑apacheConfigure Tomcat for clustering by editing apache-tomcat-8.0.20 / conf / server.xml. Addxml配置Tomcat进行集群。 jvmRoute ="node01" to the Engine tag and uncomment the Cluster tag.“node01” 添加Engine标记并取消注释Cluster标记。

Code Block
<Engine name="Catalina" defaultHost="localhost" jvmRoute="node01">
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>

配置本地域IP。验证本地服务器名称解析为IP而不是127Configure local domain IP. Verify that the local server name resolves to the IP and not 127.0.1.1. Assuming the server name is server1 and the IP is 192.1。假设服务器名称为server1,IP为192.168.1.10, edit 10,请编辑/ etc / hosts and set:hosts并设置:

Code Block
192.168.1.10 server1
 

通过运行ifconfig验证应用程序服务器之间的组播是否启用并查找MULTICAST。 如果有问题,请尝试Verify multicast is enabled between the application servers by running ifconfig and look for MULTICAST. Try http://blogs.agilefaqs.com/2009/11/08/enabling-multicast-on-your-macos-unix/ if there are issues.Restart the Tomcat servers.

重新启动Tomcat服务器。

Code Block
sudo cd /opt/joget/apache-tomcat-8.0.20
sudo ./bin/catalina.sh stop
sudo ./bin/catalina.sh start

Verify session replication working between the application servers. The catalina.out log file in 验证应用程序服务器之间的会话复制。apache-tomcat-8.0.20 / logs should show something similar to:logs中catalina.out日志文件应显示类似于:

Code Block
INFO: Starting clustering manager at localhost#/jw
Jan 17, 2016 11:21:32 AM org.apache.catalina.ha.session.DeltaManager getAllClusterSessions
INFO: Manager [localhost#/jw], requesting session state from org.apache.catalina.tribes.membership.MemberImpl[tcp://{127, 0, 0, 1}:4001,{127, 0, 0, 1},4001, alive=55733886, securePort=-1, UDP Port=-1, id={-57 118 -98 -98 110 -38 64 -68 -74 -25 -29 101 46 103 5 -48 }, payload={}, command={}, domain={}, ]. This operation will timeout if no session state has been received within 60 seconds.
Jan 17, 2016 11:21:32 AM org.apache.catalina.ha.session.DeltaManager waitForSendAllSessions
INFO: Manager [localhost#/jw]; session state send at 1/17/16 11:21 AM received in 104 ms.

More information on Tomcat clustering is at 有关Tomcat集群的更多信息,请参阅 http://tomcat.apache.org/tomcat-8.0-doc/cluster-howto.html

 

Configure Load Balancer

配置负载平衡器

在负载平衡器服务器中,安装Apache In the load balancer server, install Apache HTTP Server 

Code Block
sudo apt-get install apache2
 

安装代理和平衡器模块Install proxy and balancer modules

Code Block
sudo a2enmod headers proxy proxy_balancer proxy_http
 

使用代理和平衡器模块配置新站点。Configure a new site with the proxy and balancer modules. Create a new file in /etc/apache2/sites-available, named jwsiteavailable中创建一个名为jwsite的新文件

Code Block
sudo vim /etc/apache2/sites-available/jwsite.conf 

Add the contents添加内容

Code Block
NameVirtualHost *
<VirtualHost *>
	    DocumentRoot "/var/www/jwsite"
    
	ServerName localhost
	    ServerAdmin support@mycompany.com
	    DirectoryIndex index.html index.htm
 
	   <Proxy balancer://cluster>
		        BalancerMember http://server1:8080 route=node01
		        BalancerMember http://server2:8080 route=node02
		        Order deny,allow
		        Allow from all
	    </Proxy>
    
	ProxyPreserveHost On
	    ProxyPass /jw balancer://cluster/jw stickysession=JSESSIONID
	    ProxyPassReverse /jw balancer://cluster/jw
</VirtualHost>

Enable the new site and restart Apache启用新的站点并重新启动Apache

Code Block
sudo a2ensite jwsite
sudo service apache2 reload

Deploy and Configure Joget Workflow LEE



部署和配置Joget工作流LEE

Deploy and configure Joget Workflow LEE as described earlier in 如前面2.2 Joget Clustering ConfigurationJoget集群配置中所述部署和配置Joget Workflow LEE