Introduction
介绍
Overview
概观
本文旨在描述在集群环境中部署Joget Workflow Large Enterprise Edition(LEE)以实现可伸缩性和冗余性所需的步骤。
Requirements
要求
为了使群集起作用,需要大型企业版。由于许可限制,标准企业版将不起作用。集群需要准备和配置几个层:
Load Balancers
负载平衡器
Application Servers
应用服务器
Shared File Directory
共享文件目录
Shared Database
共享数据库
Architecture
架构
设计集群架构的方法有很多,但核心概念是相似的。在本文档中,使用的架构如下所示:
Deployment and Configuration Guide
部署和配置指南
本指南介绍了安装Joget Workflow LEE集群所需的步骤。确切的步骤将取决于每层中使用的实际产品。
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.
Pre-Deployment Requirements
预部署要求
在可以完成集群安装之前,需要以下先决条件:
Shared file directory
共享文件目录
公用目录由具有读/写权限的应用程序服务器访问。该目录用于存储共享配置文件,系统生成的文件和上传的文件。验证共享目录是否安装在应用程序服务器上,并且可以通过读取和写入权限访问文件。
Shared database
共享数据库
公用数据库由具有选择,更新,删除,创建和更改表的权限的应用程序服务器访问。验证应用程序服务器是否可以连接和查询共享数据库。
Application servers
应用服务器
Java Web应用程序服务器将在群集中的每个服务器上安装并运行。验证每个应用程序服务器是否已正确安装,并且可以通过Web浏览器进行访问。
Session replication
会话复制
会话复制要在应用程序服务器和网络上配置。验证是否为每个应用程序服务器和网络配置了会话复制。
Load balancer
负载平衡器
要安装和配置负载平衡器(硬件或软件),以便将以/ jw开头的请求的流量导向应用程序服务器。验证是否已正确安装并配置了负载平衡器,以便将Web流量导向到各个应用程序服务器。
Joget Clustering Configuration
Joget工作流集群配置
确保预部署要求已得到验证,这一点非常重要。一旦通过验证,Joget Workflow的具体步骤如下:
Datasource Configuration
数据源配置
在共享目录中配置数据源属性文件
Copy all the files and directories from the wflow directory of a Joget LEE bundle into the shared file directory.
将文件app_datasource.properties和app_datasource-default.properties从标准Joget安装的wflow目录复制到共享文件目录中。
Edit app_datasource-default.properties and set the database connection settings for the shared database, e.g. for MySQL, change the bold values below:
编辑app_datasource-default.properties并设置共享数据库(例如MySQL)的数据库连接设置,更改下面的粗体值:
workflowDriver=com.mysql.jdbc.Driver workflowUrl=jdbc\:mysql\://host\:port/database_name?characterEncoding\=UTF-8 workflowUser=username profileName= workflowPassword=password
Application Deployment and Configuration
应用程序部署和配置
将Joget WAR文件部署到应用程序服务器,并将启动属性配置为指向共享目录。
Deploy the WAR file jw.war from the Joget installation bundle to each of the application servers e.g. for Apache Tomcat, copy the files into the webapps directory
将WAR文件jw.war和jwdesigner.war从LEE包中部署到每个应用服务器,例如Apache Tomcat,将这些文件复制到tomcat webapps目录
For Joget DX 8, the wflow-cluster.jar file is already included and configured in the default startup script. Modify the JAVA_OPTS in the startup script if necessary (particularly regarding the shared directory path).
在应用程序服务器启动中添加Java -wflow.home = shared_directory_path选项,例如,对于Apache Tomcat,请修改JAVA_OPTS行
export JAVA_OPTS="-Xmx1024M -Dwflow.home=/shared_directory_path -javaagent:/shared_directory_path/wflow-cluster.jar -javaagent:/path_to/lib/aspectjweaver-1.9.7.jar -javaagent:/shared_directory_path/glowroot/glowroot.jar"
Please note that -Dwflow.name= is optional, but it is required if your nodes are in the same server. -Dwflow.name= must be placed before -javaagent:/shared_directory_path/wflow-cluster.jar.
Example: -Dwflow.name=node1
License Activation
许可证激活
For more info about license activation, see Activate your Joget DX Enterprise License.
激活每个服务器的许可证。每台服务器都有一个唯一的系统密钥,需要单独的许可证激活。
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
对于每个应用程序服务器,使用浏览器直接访问Joget Web控制台,绕过负载平衡器,例如 {+} http:// server1:8080 / jw / web / console / home +
Request for license and activate it using the link in the web console footer.
请求许可证并使用的Web控制台页脚中的链接激活它。
Post-Deployment Testing
部署后测试
一旦完成了预部署和集群配置,测试就是使用的Web浏览器访问负载平衡器。
Sample Installation and Configuration
示例安装和配置
This sample describes an installation using the following products:
本示例介绍使用以下产品进行的安装:
Joget Joget工作流程 | Joget DX 8 EE |
Load Balancer 负载平衡器 | Apache HTTP Web Server 2.4 with mod_proxy and mod_balancer (proxy and load balancing modules) running on Ubuntu 18.04 Apache HTTP Web服务器2.4与在Ubuntu 18.04上运行的mod_proxy和mod_balancer(代理和负载平衡模块) |
Application Servers 应用服务器 | Apache Tomcat 8.5 running on Ubuntu 18.04 运行在Ubuntu 18.04上的Apache Tomcat 8.5 |
Shared File Directory 共享文件目录 | NFS on Ubuntu 18.04 NFS 18.04上的NFS |
Shared Database 共享数据库 | MySQL 5.7 on Ubuntu 18.04 Ubuntu 18.04上的MySQL 5.7 |
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
创建一个共享文件目录
In this sample, the shared file directory will be a directory /export/wflow in the file server
共享应用程序服务器要访问的文件目录。该目录用于存储配置文件,系统生成的文件和上传的文件。
在此示例中,共享文件目录将是文件服务器中的目录 / export / wflow
In the file server, install the NFS server
在文件服务器中,安装NFS服务器
sudo apt-get install portmap nfs-kernel-server
Create shared directory and set permission
创建共享目录并设置权限
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
配置NFS导出共享目录,编辑 / etc / exports 将目录导出到本地192.168.1.0子网中
sudo vim /etc/exports
The /etc/exports should contain the following:
在 /etc/exports 中 应包含以下内容:
/export/wflow 192.168.1.0/255.255.255.0(rw,no_subtree_check,async)
Export the shares and restart NFS service
导出共享并重新启动NFS服务
sudo exportfs -ra sudo service nfs-kernel-server restart
Mount the Shared Directory in the Application Servers
将共享目录挂载到应用程序服务器中
在应用程序服务器中,安装NFS客户端
apt-get install nfs-common
Create new directory /opt/joget/shared/wflow to mount the shared directory and set the directory permissions
创建新目录 / opt / joget / shared / wflow 来挂载共享目录并设置目录权限
sudo mkdir -p /opt/joget/shared/wflow sudo chmod 777 /opt/joget/shared/wflow
Mount the shared directory.
安装共享目录。
sudo mount -t nfs wflow:/export/wflow /opt/joget/shared/wflow
Test read-write permissions to confirm that the directory sharing works.
测试读写权限以确认目录共享是否有效。
echo test123 > /opt/joget/shared/wflow/test.txt
Create a Shared Database
创建一个共享数据库
sudo apt-get install mysql-server
Create a database called jwedb accessible to the application servers.
创建一个名为 jwedb 的应用程序服务器可访问的数据库。
mysql -u root
Run the following MySQL commands to create a blank database
运行以下MySQL命令来创建一个空白数据库
create database jwedb; quit
Populate the newly created database with the Joget database schema
使用Joget数据库模式填充新创建的数据库
mysql -uroot jwedb < /path/to/jwdb-mysql.sql
Configure database permissions
配置数据库权限
mysql -u root
Run the following MySQL commands to grant permissions to user joget and password joget
运行以下MySQL命令来授予用户 joget 和密码 joget的权限
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
配置MySQL以侦听来自远程主机的数据库连接。用你最喜欢的编辑器编辑my.cnf文件
sudo vim /etc/mysql/my.cnf
Comment away the bind-address directive by adding a # in front of the line
通过在行前添加#来注释掉bind-address指令
#bind-address = 127.0.0.1
Restart MySQL
重新启动MySQL
sudo service mysql restart
In the application server, test a remote connection to the database server database_host
在应用程序服务器中,测试到数据库服务器database_host的远程连接
mysql -h database_host -u joget -p
Deploy Application Servers
部署应用程序服务器
在每个应用程序服务器上安装Apache Tomcat。在每个应用程序服务器中,运行以下命令将tomcat解压缩到/ opt / joget中:
sudo mkdir -p /opt/joget/ sudo tar xvfz apache-tomcat-8.5.41.tar.gz /opt/joget/
Start each application server
启动每个应用服务器
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
打开Web浏览器并访问每个服务器以确认 http://server:8080/jw
Configure Application Server Session Replication
配置应用服务器会话复制
通过编辑apache-tomcat-8.0.20 / conf / server.xml配置Tomcat进行集群。将 jvmRoute =“node01” 添加 到 Engine 标记并取消注释 Cluster 标记。
<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:
配置本地域IP。验证本地服务器名称解析为IP而不是127.0.1.1。假设服务器名称为server1,IP为192.168.1.10,请编辑/ etc / hosts并设置:
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.
通过运行 ifconfig 验证应用程序服务器之间的组播是否启用并查找MULTICAST。 如果有问题, 请尝试 http://blogs.agilefaqs.com/2009/11/08/enabling-multicast-on-your-macos-unix/ 。
重新启动Tomcat服务器。
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:
验证应用程序服务器之间的会话复制。apache-tomcat-8.0.20 / logs中的 catalina.out 日志文件应显示类似于:
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
有关Tomcat集群的更多信息,请参阅 http://tomcat.apache.org/tomcat-8.5-doc/cluster-howto.html
Configure Load Balancer
配置负载平衡器
在负载平衡器服务器中,安装Apache HTTP Server
sudo apt-get install apache2
Install proxy and balancer modules
安装代理和平衡器模块
sudo a2enmod headers proxy proxy_balancer proxy_http
If you are running Apache 2.4, you will need to also enable the following module.
sudo a2enmod lbmethod_byrequests
Configure a new site with the proxy and balancer modules. Create a new file in /etc/apache2/sites-available, named jwsite
使用代理和平衡器模块配置新站点。在/etc/apache2/sites-available中创建一个名为jwsite的新文件
sudo vim /etc/apache2/sites-available/jwsite.conf
Add the contents
添加内容
NameVirtualHost * <VirtualHost *> DocumentRoot "/var/www/jwsite" ServerName localhost ServerAdmin support@example.com ErrorLog /var/log/apache2/jwsite-error.log CustomLog /var/log/apache2/jwsite-access.log combined 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
启用新的站点并重新启动Apache
sudo a2ensite jwsite sudo service apache2 reload
Deploy and Configure Joget LEE
部署和配置Joget工作流LEE
如前面2.2 Joget集群配置中所述部署和配置Joget Workflow LEE