Versions Compared

Key

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

Pagetitle
服务器集群指南
服务器集群指南


Table of Contents
indent30px
stylecircle

Introduction

Chinese

介绍


Overview

Chinese

概观

This document is intended to describe the steps required to deploy Joget Large Enterprise Edition (LEE) in a clustered environment for scalability and redundancy.

Chinese

本文旨在描述在集群环境中部署Joget Workflow Large Enterprise Edition(LEE)以实现可伸缩性和冗余性所需的步骤。

Requirements

Chinese

要求

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:

Chinese

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

  • Load Balancers

    Chinese

    负载平衡器

  • Application Servers

    Chinese

    应用服务器

  • Shared File Directory

    Chinese

    共享文件目录

  • Shared Database

    Chinese

    共享数据库

Architecture

Chinese

架构

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:

Chinese

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


Deployment and Configuration Guide

Chinese

部署和配置指南

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

Chinese

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

Warning

IMPORTANT: Please note that there is minimal configuration required in Joget 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.

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


Pre-Deployment Requirements

Chinese

预部署要求

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

Chinese

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

Shared file directory

Chinese

共享文件目录

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.

Chinese

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

Shared database

Chinese

共享数据库

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.

Chinese

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

Application servers

Chinese

应用服务器

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.

Chinese

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

Session replication

Chinese

会话复制

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.

Chinese

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

Load balancer

Chinese

负载平衡器

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.

Chinese

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


Joget Clustering Configuration

Chinese

Joget工作流集群配置

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

Chinese

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

Datasource Configuration

Chinese

数据源配置

Configure the datasource properties files in the shared directory

Chinese

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

  1. Copy all the files and directories from the wflow directory of a Joget LEE bundle into the shared file directory.

    Chinese

    将文件app_datasource.propertiesapp_datasource-default.properties从标准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:

    Chinese

    编辑app_datasource-default.properties并设置共享数据库(例如MySQL)的数据库连接设置,更改下面的粗体值:



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

Application Deployment and Configuration

Chinese

应用程序部署和配置

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

Chinese

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

  1. Deploy the WAR file jw.war from the LEE bundle to each of the application servers e.g. for Apache Tomcat, copy the files into the webapps directory

    Chinese

    将WAR文件jw.warjwdesigner.war从LEE包中部署到每个应用服务器,例如Apache Tomcat,将这些文件复制到tomcat webapps目录

  2. Add the following Java options in the application server startup e.g. for Apache Tomcat, modify the JAVA_OPTS line

    Chinese

    在应用程序服务器启动中添加Java -wflow.home = shared_directory_path选项,例如,对于Apache Tomcat,请修改JAVA_OPTS行



Code Block
export JAVA_OPTS="-Xmx1024M -Dwflow.home=/shared_directory_path -javaagent:/shared_directory_path/wflow-cluster.jar -javaagent:/path_to/lib/aspectjweaver-1.8.5.jar -javaagent:/shared_directory_path/glowroot/glowroot.jar"

License Activation

Chinese

许可证激活

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

Chinese

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

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

    Chinese

    对于每个应用程序服务器,使用浏览器直接访问Joget Web控制台,绕过负载平衡器,例如{+} http:// server1:8080 / jw / web / console / home +

  2. Request for license and activate it using the link in the web console footer.

    Chinese

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



Post-Deployment Testing

Chinese

部署后测试

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.

Chinese

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


Sample Installation and Configuration

Chinese

示例安装和配置


This sample describes an installation using the following products:

Chinese

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

Joget

Chinese

Joget工作流程

Joget DX LEE

Load Balancer

Chinese

负载平衡器

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

Chinese

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

Application Servers

Chinese

应用服务器

Apache Tomcat 8.5 running on Ubuntu 18.04

Chinese

运行在Ubuntu 18.04上的Apache Tomcat 8.5

Shared File Directory

Chinese

共享文件目录

NFS on Ubuntu 18.04

Chinese

NFS 18.04上的NFS

Shared Database

Chinese

共享数据库

MySQL 5.7 on Ubuntu 18.04

Chinese

Ubuntu 18.04上的MySQL 5.7

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.

Chinese

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

Create a Shared File Directory

Chinese

创建一个共享文件目录

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

Chinese

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


In the file server, install the NFS server

Chinese

在文件服务器中,安装NFS服务器

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

Create shared directory and set permission

Chinese

创建共享目录并设置权限

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

Configure NFS to export the shared directory, edit /etc/exports to export the directory to the local 192.168.1.0 subnetwork with your favourite editor

Chinese

配置NFS导出共享目录,编辑/ etc / exports将目录导出到本地192.168.1.0子网中

Code Block
sudo vim /etc/exports 

The /etc/exports should contain the following:

Chinese

/etc/exports应包含以下内容:

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

Export the shares and restart NFS service

Chinese

导出共享并重新启动NFS服务

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


Mount the Shared Directory in the Application Servers

Chinese

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

In the application servers, install the NFS client

Chinese

在应用程序服务器中,安装NFS客户端

Code Block
apt-get install nfs-common

Create new directory /opt/joget/shared/wflow to mount the shared directory and set the directory permissions

Chinese

创建新目录/ opt / joget / shared / wflow来挂载共享目录并设置目录权限

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

Mount the shared directory.

Chinese

安装共享目录。

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

Test read-write permissions to confirm that the directory sharing works.

Chinese

测试读写权限以确认目录共享是否有效。

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

Create a Shared Database

Chinese

创建一个共享数据库

Install MySQL (https://help.ubuntu.com/18.04/serverguide/mysql.html)

Chinese

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

Code Block
sudo apt-get install mysql-server

Create a database called jwedb accessible to the application servers.

Chinese

创建一个名为jwedb的应用程序服务器可访问的数据库。

Code Block
mysql -u root 

Run the following MySQL commands to create a blank database

Chinese

运行以下MySQL命令来创建一个空白数据库

Code Block
create database jwedb;
quit

Populate the newly created database with the Joget database schema

Chinese

使用Joget数据库模式填充新创建的数据库

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

Configure database permissions

Chinese

配置数据库权限

Code Block
mysql -u root 

Run the following MySQL commands to grant permissions to user joget and password joget

Chinese

运行以下MySQL命令来授予用户joget和密码joget的权限

Code Block
grant all privileges on jwedb.* 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

Chinese

配置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

Chinese

通过在行前添加#来注释掉bind-address指令

Code Block
#bind-address = 127.0.0.1 

Restart MySQL

Chinese

重新启动MySQL

Code Block
sudo service mysql restart

In the application server, test a remote connection to the database server database_host

Chinese

在应用程序服务器中,测试到数据库服务器database_host的远程连接 

Code Block
mysql -h database_host -u joget -p



Deploy Application Servers

Chinese

部署应用程序服务器

Install Apache Tomcat on each of the application servers. In each application server, run the following to extract tomcat into /opt/joget:

Chinese

在每个应用程序服务器上安装Apache Tomcat。在每个应用程序服务器中,运行以下命令将tomcat解压缩到/ opt / joget中:

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

Start each application server

Chinese

启动每个应用服务器

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

Open a web browser and access each server to confirm that http://server:8080/jw

Chinese

打开Web浏览器并访问每个服务器以确认http://server:8080/jw



Configure Application Server Session Replication

Chinese

配置应用服务器会话复制

Configure Tomcat for clustering by editing apache-tomcat-8.5.41/conf/server.xml. Add jvmRoute="node01" to the Engine tag and uncomment the Cluster tag.

Chinese

通过编辑apache-tomcat-8.0.20 / conf / server.xml配置Tomcat进行集群。将 jvmRoute =“node01” 添加Engine标记并取消注释Cluster标记。

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

Configure 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.168.1.10, edit /etc/hosts and set:

Chinese

配置本地域IP。验证本地服务器名称解析为IP而不是127.0.1.1。假设服务器名称为server1,IP为192.168.1.10,请编辑/ etc / hosts并设置:

Code Block
192.168.1.10 server1

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.

Chinese

通过运行ifconfig验证应用程序服务器之间的组播是否启用并查找MULTICAST。 如果有问题,请尝试http://blogs.agilefaqs.com/2009/11/08/enabling-multicast-on-your-macos-unix/

重新启动Tomcat服务器。

Code Block
sudo cd /opt/joget/apache-tomcat-8.5.41
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.5.41/logs should show something similar to:

Chinese

验证应用程序服务器之间的会话复制。apache-tomcat-8.0.20 / 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 http://tomcat.apache.org/tomcat-8.5-doc/cluster-howto.html

Chinese

有关Tomcat集群的更多信息,请参阅 http://tomcat.apache.org/tomcat-8.5-doc/cluster-howto.html


Configure Load Balancer

Chinese

配置负载平衡器

In the load balancer server, install Apache HTTP Server 

Chinese

在负载平衡器服务器中,安装Apache HTTP Server 

Code Block
sudo apt-get install apache2

Install proxy and balancer modules

Chinese

安装代理和平衡器模块

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 jwsite

Chinese

使用代理和平衡器模块配置新站点。在/etc/apache2/sites-available中创建一个名为jwsite的新文件

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

Add the contents

Chinese

添加内容

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

Enable the new site and restart Apache

Chinese

启用新的站点并重新启动Apache

Code Block
sudo a2ensite jwsite
sudo service apache2 reload



Deploy and Configure Joget LEE

Chinese

部署和配置Joget工作流LEE

Deploy and configure Joget LEE as described earlier in 2.2 Joget Clustering Configuration

Chinese

如前面2.2 Joget集群配置中所述部署和配置Joget Workflow LEE