Rollbase Scalability – Part Two

Progress-logo-Rollbase-whitebackground

 

 

My previous article on scalability laid some ground rules around server sizes and gave you some homework to get ready for actually setting up a multi server Rollbase installation. In this article we will actually start to build it!

Originally I had everything crammed into this article, but it has turned out to be very long. So in the article I will focus on setting up the Database and Apache Servers – the next article will deal with Rollbase itself. We will only touch our Main Server briefly here in order to download the installation files.

Recap: Initial Scalable Installation

So let’s go through the process of setting up an initial useful and, above all, scalable installation.

We are going to focus here on an architecture that has:

  • One Apache Server acting as the web tier and using mod_jk.
  • A Main Server with all the services listed above except the database and production services
  • One (optionally two) servers to provide Production Server functionality – PROD1 and, optionally, PROD2
  • A single Database Server

See the diagram below for what this architecture will look like:

Scalability-Architecture-One

I am going to assume now that you have done your homework.

Let’s get started!

This stage consists of three parts:

  • Configure the Apache Server
  • Download and extract the Rollbase zip files on the Main Server
  • Configure a Database Server to work with Rollbase

Configure the Apache Server

In this part, you will configure the Apache Server.

This server will listen for requests coming in on port 80 and then route them to the appropriate rollbase servers

We will set this up in such a manner that expansion will be relatively easy.

Configuration

If an appropriate file was not created during the module install process, create the workers.properties file in the mod_jk configuration directory. For example:

  • Windows: C:\Program Files\Apache Group\Apache2\modules\
  • Ubuntu: /etc/libapache2-mod-jk/

Once you have done that, or if a workers.properties file was already created then append the following entries noted in the next section to that file.

What am I about to do?

You are now going to tell the Apache Server about the tomcat services (or workers) you want to redirect a request to when certain paths exist in the URL being used to connect to your server. There are two (optionally three) servers – the Main Server and the one (optionally two) Production Server(s).

Firstly you will actually describe the workers to the system and how to connect to them.

To do this, add master,prod1,prod2 (the names of the rollbase servers) to the worker.list parameter, or use worker.list=master,prod1,prod2 if one does not exist. This tells Apache what workers to expect.

To describe to apache how to actually connect to them, enter the following configuration details, referring to your appropriate IP addresses to replace $MASTERIP$, $PROD1IP$ and (optionally) $PROD2IP$ with their appropriate values as you recorded when doing your homework.

## Firstly you will actually describe the workers to the system and how to connect to them.

worker.list=master,prod1,prod2

## To describe to apache how to actually connect to them, enter the
## following configuration details, referring to your appropriate IP
## addresses to replace $MASTERIP$, $PROD1IP$ and (optionally) $PROD2IP$
## with their appropriate values as you recorded when doing your homework.
## master
worker.master.type=ajp13
worker.master.host=$MASTERIP$
worker.master.port=8009
worker.master.socket_timeout=0
worker.master.socket_keepalive=1
worker.master.connection_pool_timeout=60
worker.master.connection_pool_size=300
worker.master.connection_pool_minsize=50

## prod1
worker.prod1.type=ajp13
worker.prod1.host=$PROD1IP$
worker.prod1.port=8009
worker.prod1.socket_timeout=0
worker.prod1.socket_keepalive=1
worker.prod1.connection_pool_timeout=60
worker.prod1.connection_pool_size=300
worker.prod1.connection_pool_minsize=50

## Optional - use only if you wish
## to have a second production server prod2

##prod2
worker.prod2.type=ajp13
worker.prod2.host=$PROD2IP$
worker.prod2.port=8009
worker.prod2.socket_timeout=0
worker.prod2.socket_keepalive=1
worker.prod2.connection_pool_timeout=60 worker.prod2.connection_pool_size=300 worker.prod2.connection_pool_minsize=50

Save the workers.properties file

The next five steps will depend heavily on what platform you have installed this on, so you will need to fall back on your platform’s apache and mod_jk instructions to perform accordingly.

What am I about to do?

You are now going to modify the configuration of the default web site that listens on port 80 how to deal with requests for specific paths as they come in to the system. If your site is http://bobafettlives.com, for example, the standard login page is at http://bobafettlives.com/router/login/loginPrivate.jsp

With a JkMount entry such as:

 JkMount /router master
 JkMount /router/* master

Apache will route any request where ‘router’ is the root of the URL path to the worker labelled as “master” – which we described in the above workers.properties file.

Now, for each of the services in a standard rollbase installation, we need to tell Apache which service will be handled by what worker. The directives below route everything except for Production Services to the “master” worker. In rollbase a service is identified as the root item in the URL path – e.g. router, master, rest, etc.

Why ‘prod1’ and ‘prod2’?

Because we are providing Production Services on a seperate system (or systems) we need to tell Apache when to route requests to those servers. When the main server is aware of more than one Production Server, it will load balance sessions to each of the servers. An advanced mode also allows you to dedicate customers to specific production servers – I will cover that mode in a future article.

We will be naming the services as PROD1 and PROD2 – and a request to these services will be in the form of http://<SERVER FQDN:PORT>/prod1… or http://<SERVER FQDN:PORT>/prod2…

In the mod_jk configuration file

  • Make sure the JkWorkersFile directive points to where you have the workers.properties file located
  • Make sure the JkLogFile directive points to where you want the logs to be stored
  • Set the JkLogLevel directive to info (unless you need to troubleshoot)

In the configuration file for the VirtualHost *:80 site

(usually in sites-enabled/000-default.conf – but again this may be different by platform)

  • specify which worker will deal with each Rollbase component by adding the following JkMount entries to the existing <VirtualHost *:80> section. Note that each service has TWO entries – one for calling the service directly and one for any URL containing the service in its path. 
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# … other stuff already in the file

 JkMount /workflow master
 JkMount /workflow/* master
 JkMount /storage master
 JkMount /storage/* master
 JkMount /webapi master
 JkMount /webapi/* master
 JkMount /search master
 JkMount /search/* master
 JkMount /rest master
 JkMount /rest/* master
 JkMount /rss master
 JkMount /rss/* master
 JkMount /master master
 JkMount /master/* master
 JkMount /router master
 JkMount /router/* master
 JkMount /prod1 prod1
 JkMount /prod1/* prod1

# Optional - use only if you have a second Production Server (PROD2)
 JkMount /prod2 prod2
 JkMount /prod2/* prod2

 JkMountCopy On
</VirtualHost>
  • To increase the performance of the apache server, install and enable the Apache Worker Multi Processor Module (mpm)
  • Windows users: there may be an issue depending on the network drivers being used – including Virtual Machine (VM) network drivers. Essentially Apache appears to freeze up after spawning the first thread connection. That specific client can continue to connect to the Apache server, but new clients are blocked. To get around this, add to the httpd.conf file (on Windows):
    AcceptFilter http none
    AcceptFilter https none
    EnableSendfile off
    EnableMMAP off
  • Save the file and restart your Apache Server.

Apache should now be configured. However it is a little bit difficult to test right now as you don’t have any Rollbase servers running.

Download and extract the Rollbase zip files on the Main Server

Base Installation

  • Install and patch your chosen OS onto the server you have designated as the Main Server
  • Use the IP address you have noted for $MASTERIP$ in the steps above. Note this does not have to be an address accessible directly from the Internet, however it MUST be accessible from your Apache Server Web Tier.
  • Install Java and Tomcat for your chosen OS

Download and extract the Rollbase Files

  • Create a Rollbase working directory on your Main Server (the system on which you will download the Rollbase files). Future references to this folder will designated as $ROLLBASE$.
  • Create sub-directories named rollbase, lib, and webapps in $ROLLBASE$Note: The rollbase sub-directory will become the root directory of the Rollbase application. You should ensure that the owner of this folder is the user under which the tomcat processes will be running. On Ubuntu, for example, that user is tomcat7 (on a tomcat7 install)
  • Download the rollbase, lib, and webapps zip files from the Rollbase Private Cloud Downloads Portal (http://www.progress.com/products/rollbase/try- it/private-cloud). You may need to register for an account.
  • Extract the files into their respective sub-directories. That is, extract the rollbase.zip file into the rollbase sub-directory, lib.zip file into the lib sub- directory, and the webapps.zip file into the webapps sub-directory.

Configuring a Database Server to work with Rollbase

Here I will provide instructions for configuring both of the following databases – you choose one – or refer to our documentation for general database setup for other supported databases:

  • an OpenEdge database, rbdb, with dbadmin as both the username and password,
  • or a MySQL database RB_DBO using the username provided (root) and password created during setup (you can of course create an additional user instead if you wish).

Most of these actions will be performed on the Database Server. There will also be some additional actions performed on the Main Server.

Base Installation

  • Install and patch your chosen OS onto the server you have designated as the Database Server
  • Record the IP address to be referred to later as $DATABASEIP$.
  • Install your chosen Database.

Remember to install the appropriate driver into your tomcat instance on the Main Server (and later on, on the Production Servers).

The following instructions cover OpenEdge and MySQL, you can check our documentation for our other supported databases.

OpenEdge

  • On the Main Server, In the $ROLLBASE$/rollbase/sql directory, locate the create_oedb script and the create_oe.sql file. Copy these file to somewhere accessible on your Database Server – they should be located in the same directory.
  • Login to the Database Server and perform the following:
  • Navigate to the directory which contains the create_oedb script (create_oedb.sh for Linux, create_oedb.bat for Windows).
  • Start the Progress environment using the proenv utility from the OpenEdge bin directory
  • Use cd to change the directory to the location of the create_oedb script.
  • Enter create_oedb to execute the script. This creates the Rollbase schema and database.
  • On the Main Server, navigate to $ROLLBASE$/rollbase/config.
  • Open the databases.xml file in a text editor and make it look like the following, remembering to substitute the correct IP address for $DATABASEIP$ and the correct DbUser and Password values:
<?xml version="1.0" encoding="UTF-8" ?>
   <Databases>
      <Database name="RB" isDefault="yes" isExternal="no"
                MinConnections="3" MaxConnections="10"
                MaxInUseConnTimeMins="30"
                MaxNotUsedConnTimeMins="1"
                MaxConnLifetimeMins="60"
                TxIsolation="2" useTxRecovery="yes">
         <Driver>com.ddtek.jdbc.openedge.OpenEdgeDriver</Driver>
         <Url>
   jdbc:datadirect:openedge://$DATABASEIP$:8911;databaseName=rbdb
         </Url>
         <DbUser>$DB_USER_NAME{0}lt;/DbUser
         <Password>$DB_PASSWORD{0}lt;/Password>
      </Database>
   </Databases>
  • Save the changes.

MySQL

Note that for mysql, you must ensure the database can be queried externally. The easiest way to enable this is to comment out the line bind-address = 127.0.0.1 in the mysqld.cnf file – however this is not necessarily the most secure way to do this. Refer to the MySQL documentation to create a configuration that meets your security requirements.

  • On the Main Server, in the $ROLLBASE$/rollbase/sql folder, locate the create_mysql.sql  file. Copy the file to somewhere accessible on your Database Server.
  • Login to your Database Server and either run the script from the command line, or use MySQL Workbench:
  • On Linux or Unix systems use a Terminal service to run the mysql command, then use the source command to run the create_mysql.sql script.
  • On Windows systems, use the mysql command line tool as in Linux above, or install MySQL Workbench.

To use the Workbench:

  • Start from the Workbench Central screen and click New Connection.
  • In a dialog enter a name for the new connection and specify a password for the root user.
  • Open the newly created connection by double-clicking it.
  • From the menu select File > Open SQL Script. Locate and open the create_mysql.sql file in the location where copied it.
  • Use the menu Query > Execute (All or Selection) to run the script from the opened SQL file and create the Rollbase database RB_DBO and all tables.
  • Click Refresh in the SCHEMAS sidebar area. You should see an RB_DBO database and a list of tables inside, such as rb_act_trail, etc.

Next, you will modify the Rollbase database configuration file (databases.xml).

  • On the Main Server, navigate to $ROLLBASE$/rollbase/config.
  • Open the databases.xml file in a text editor and make it look like the following, remembering to substitute the correct IP address for $DATABASEIP$ and the correct DbUser and Password values::
<?xml version="1.0" encoding="UTF-8" ?>
   <Databases>
      <Database name="RB" isDefault="yes" isExternal="no"
                MinConnections="3"
                MaxConnections="10" MaxInUseConnTimeMins="30"
                MaxNotUsedConnTimeMins="1" 
                MaxConnLifetimeMins="60"
                TxIsolation="2" useTxRecovery="yes">
         <Driver>com.mysql.jdbc.Driver</Driver
         <Url>jdbc:mysql://$DATABASEIP$:3306/RB_DBO</Url>
         <DbUser>$DBUSER{0}lt;/DbUser>
         <Password>$PASSWORD{0}lt;/Password>
      </Database>
   </Databases>

Save the changes.

Ok that’s it for now. In summary, so far we have:

  1. installed our OS of choice on the various servers that will make up our installation;
  2. installed and setup Apache on the server acting as the web tier (the Apache Server);
  3. downloaded the Rollbase application files and scripts onto our Main Server;
  4. installed and configured the database software on our Database Server, including executing the scripts that create the reburied database tables.

Next Article

In the next article we will setup our Main Server and our Production Server(s).

Articles in this Series

Rollbase Scalability – Part One

Rollbase Scalability – Part Two

Rollbase Scalability – Part Three

 

 

2 thoughts on “Rollbase Scalability – Part Two”

Leave a Reply

Your email address will not be published. Required fields are marked *