How Can We Help?
Split up Pure webapps on more than one TomcatSplit up Pure webapps on more than one Tomcat
This guide describes how to split up Pure on multiple Tomcats.
This can be done on one server, or the Tomcats can be split out on multiple servers.
Prerequisites
If the tomcats are running on separate servers, they will need to share the file system where Pure stores the binary files and search index, and all the servers will need access to the Pure database.
Multiple Tomcats, same server
In this setup we will run admin, ws, and portal in separate Tomcats, but on the same server.
This will make the setup a bit more robust, as one webapp will not be able to bring down all of them.
It will also be possible to shutdown one webapp while keeping the others running.
When upgrading Pure you will need to shutdown all Tomcats before starting the upgrade.
This will also use more memory overall, as each Tomcat will have its own Java VM running!
Linux
Follow the normal Linux installation guide Installing Pure on Linux but do the following changes
Paths
Instead of /data/tomcat_base we will need a folder for each Tomcat:
sudo mkdir -p /data/tomcats/admin
sudo mkdir -p /data/tomcats/ws
sudo mkdir -p /data/tomcats/portal
sudo chown -R tomcat:tomcat /data/tomcats
This will create one folder that will contain the three Tomcat folders, one for each Pure webapp.
Tomcat
We will need to copy the Tomcats folders to each Pure webapp folder:
cd /pack/tomcat8
cp -r conf logs temp webapps work /data/tomcats/admin/.
cp -r conf logs temp webapps work /data/tomcats/ws/.
cp -r conf logs temp webapps work /data/tomcats/portal/.
Server.xml
This section should be done for each Tomcat folder, and the ports should be changed so they do not clash.
Remember to also change the server shutdown port
Admin
emacs /data/tomcats/admin/conf/server.xml
<Server port="8005" shutdown="SHUTDOWN">
...
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
URIEncoding="UTF-8"
redirectPort="8443" />
...
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" URIEncoding="UTF-8" />
WS
emacs /data/tomcats/ws/conf/server.xml
<Server port="8006" shutdown="SHUTDOWN">
...
<Connector port="8081" protocol="HTTP/1.1"
connectionTimeout="20000"
URIEncoding="UTF-8"
redirectPort="8443" />
...
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8010" protocol="AJP/1.3" redirectPort="8443" URIEncoding="UTF-8" />
Portal
emacs /data/tomcats/portal/conf/server.xml
<Server port="8007" shutdown="SHUTDOWN">
...
<Connector port="8082" protocol="HTTP/1.1"
connectionTimeout="20000"
URIEncoding="UTF-8"
redirectPort="8443" />
...
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8011" protocol="AJP/1.3" redirectPort="8443" URIEncoding="UTF-8" />
Tomcat init script
You will need a copy of the init script for each Tomcat. This example assumes that you have already copied the tomcat script to /etc/init.d
cd /etc/init.d cp tomcat tomcat_ws cp tomcat tomcat_portal mv tomcat tomcat_admin |
Edit each script as specified, but also change the following line to match each Tomcat
# Tomcat base directory where Pure is deployed export CATALINA_BASE=/data/tomcat_base
|
Admin
# Tomcat base directory where Pure is deployed export CATALINA_BASE=/data/tomcats/admin
|
WS
# Tomcat base directory where Pure is deployed export CATALINA_BASE=/data/tomcats/ws
|
Portal
# Tomcat base directory where Pure is deployed export CATALINA_BASE=/data/tomcats/portal
|
Database connection configuration
It is recommended to use the properties file for the database configuration, so you will only have the information in one place, instead of having it in each Tomcat script.
Deploy script
You will need the following changes to the deploy script
TOMCAT_BASE=/data/tomcats DEPLOY_ADMIN=$TOMCAT_BASE/admin/webapps DEPLOY_WS=$TOMCAT_BASE/ws/webapps DEPLOY_PORTAL=$TOMCAT_BASE/portal/webapps ... # Deploy each component under the path specified here. The first element in deploypath will be the path for the first element in components. # If they should all be deployed to the same path only the DEPLOY value above should be changed. declare -a deploypath=($DEPLOY_ADMIN $DEPLOY_WS $DEPLOY_PORTAL)
|
Start Pure
Remember that there is now more than one Tomcat, so you will need to start all three starting with the Admin
/etc/init.d/tomcat_admin start /etc/init.d/tomcat_ws start /etc/init.d/tomcat_portal start |
The maintenance information will be in the Admin log file
less /data/tomcats/admin/logs/console.log |
Reverse proxy
In this setup it is recommended to have a reverse proxy server in front of the Tomcats, so your users can access Pure using one URL instead of having to specify the correct port for each webapp.
Without a reverse proxy the Pure webapps will need to be accessed something like this: http://servername:8080/admin, http://servername:8081/ws, and http://servername:8082/portal
See the Reverse proxy guide for more information about how to configure this.
Windows
Follow the normal Installing Pure on Windows guide but do the following changes
Tomcat
Follow the normal guide, but do the Tomcat section three times with the following changes.
Each installation should use unique ports and service names
The three examples here is using the default settings for Pure Admin, and changed ports and service names for Pure WS and Portal.
You should also make sure that the installation folders is unique, but the default is to append the Windows service name if it is changed from the default Tomcat8, so it should not be necessary to change it.
You should then end out with a layout similar to this
Remember to do the rest of the Tomcat configuration from the install guide for each installed Tomcat.
You might want to use the properties file for the database connection, so you only have the configuration in one place of all Tomcats.
Deploy script
You will also need to make changes to the deploy script, as it will now need to deploy to three Tomcats instead of one.
Duplicate the DEP variable, so you have three of them named DEP1, DEP2, and DEP3 and point them to a different Tomcats.
Then you need to change all places that use the DEP variable to use one of the new DEP variables that matches the webapp.
In the following example the variable DEP3 is for the Portal Tomcat, so every line that is for handling the Portal is changed from DEP to DEP3.
Start Pure
Remember that there will now be more than one Tomcat service
Reverse proxy
In this setup it is recommended to have a reverse proxy server in front of the Tomcats, so your users can access Pure using one URL instead of having to specify the correct port for each webapp.
Without a reverse proxy the Pure webapps will need to be accessed something like this: http://servername:8080/admin, http://servername:8081/ws, and http://servername:8082/portal
See the Reverse proxy guide for more information about how to configure this.
Multiple Tomcats, multiple servers
In this setup we will run admin, ws, and portal in separate Tomcats, and the Tomcats will be running on separate servers.
This will make the setup more robust, as one webapp will not be able to bring down all of them. and it will also make it easier to scale each server according to the amount of traffic for the specific webapp.
The total amount of memory needed for all servers will be larger than the requirements for one server, as each Tomcat will have its own Java VM running.
You will need to shutdown Tomcat on all servers before installing a Pure upgrade, and you need to deploy the new version to all servers before starting Pure again.
Linux
Follow the normal Installing Pure on Linux but do the following changes
Paths
The folder /data/pure_data should be on a shared file system like NFS, and it should be mounted in the same path on each server.
Deploy script
The deploy script should only deploy one webapp on each server.
Change the following lines in each script to match the Pure webapp that should be deployed.
This example is for the admin webapp:
# What modules to deploy
declare -a components=(admin)
# Deploy each component under the name specified here. The first element in deployname will be the name for the first element in components. declare -a deployname=(admin)
# Deploy each component under the path specified here. The first element in deploypath will be the path for the first element in components. # If they should all be deployed to the same path only the DEPLOY value above should be changed. declare -a deploypath=($DEPLOY)
|
Reverse proxy
In this setup it is recommended to have a reverse proxy server in front of the servers, so your users can access Pure using one URL instead of having to specify the correct server name for each webapp.
Without a reverse proxy the Pure webapps will need to be accessed something like this: http://servername1/admin, http://servername2/ws, and http://servername3/portal
See the Reverse proxy guide for more information about how to configure this.
Windows
Follow the normal Windows installation guide Installing Pure on Windows for each server, but with the following changes
Paths
The folder d:\pack\pure_data should be on a shared file system, that is mounted in the same location on all servers.
Deploy script
The deploy script should only deploy one webapp on each server, so you need to change each script by removing the line for the webapps that should not be deployed.
The following example only deploys the admin webapp
Reverse proxy
In this setup it is recommended to have a reverse proxy server in front of the servers, so your users can access Pure using one URL instead of having to specify the correct server name for each webapp.
Without a reverse proxy the Pure webapps will need to be accessed something like this: http://servername1/admin, http://servername2/ws, and http://servername3/portal
See the Reverse proxy guide for more information about how to configure this.
Updated at July 27, 2024