Running two instances of the framework server on the same host

There may be scenarios where you would like to install two versions of MidVision's Application Release Automation tool, on the same server. Below are instructions on how to make changes to the default configuration settings to allow dual running of framework servers.

Use different users for each instance

Ideally it is good practice to isolate each instance by running as different users to avoid CLASSPATH and other environment variables clashing.

Configure the Database

Ideally it is best to use an Oracle database for dual running mode as the HSQL database is backed up to the users home directory. If you do use a HSQL DB then it is best to start the RapidDeploy server using different user profiles.

Oracle

To change the Oracle connection settings change the connection settings in the file $MV_HOME/bin/rapiddeploy.properties to point to the Oracle DB.

rapiddeploy.datasource.username=rd_db_user1
rapiddeploy.datasource.password=rd_db_password1
rapiddeploy.datasource.url=jdbc:oracle:thin:@localhost:1521:xe1

HSQL

To change the HSQL connection you will need to change the port that the HSQL DB is open on. To do this modify the port in the file $MV_HOME/bin/rapiddeploy.properties.

rapiddeploy.built.in.hsqldb.server.port=9002

Then change the HSQL connection settings change the connection settings in the file $MV_HOME/bin/rapiddeploy.properties to point to the HSQL DB.

rapiddeploy.datasource.url=jdbc:hsqldb:hsql://localhost:9002/rapiddeploydb

Configure Bitronix

The Bitronix configuration file needs to be made server specific so that each instance uses its own transaction log file. By default the Bitronix configuration file is provided (bitronix-default-config.properties) with the following default values set:

bitronix.tm.serverId=rapiddeploy-btm-node0
bitronix.tm.journal.disk.logPart1Filename=logs/btm1.tlog
bitronix.tm.journal.disk.logPart2Filename=logs/btm2.tlog

To override the Bitronix configuration on each server instance you can specify the system property 'bitronix.tm.configuration' pointing to a new Bitronix configuration property file. The possible configuration properties are:

bitronix.tm.serverId
bitronix.tm.journal.disk.logPart1Filename
bitronix.tm.journal.disk.logPart2Filename
bitronix.tm.journal.disk.forcedWriteEnabled
bitronix.tm.journal.disk.forceBatchingEnabled
bitronix.tm.journal.disk.maxLogSize
bitronix.tm.journal.disk.filterLogStatus
bitronix.tm.journal.disk.skipCorruptedLogs
bitronix.tm.2pc.async
bitronix.tm.2pc.warnAboutZeroResourceTransactions
bitronix.tm.timer.defaultTransactionTimeout
bitronix.tm.timer.gracefulShutdownInterval
bitronix.tm.timer.backgroundRecoveryIntervalSeconds
bitronix.tm.disableJmx
bitronix.tm.jndi.userTransactionName
bitronix.tm.jndi.transactionSynchronizationRegistryName
bitronix.tm.journal
bitronix.tm.currentNodeOnlyRecovery
bitronix.tm.resource.configuration

Changing the serverID is often sufficient (depending on your other configuration) to allow multiple instances to run since the logfiles are generally relative to the running instance

See the Bitronix web site for further configuration details.

Configure the Remote Agent

To run a separate instance of the remote agent on the same server then you will need to change the port and the multicast port defined in the remote agent xml configuration file.

Edit the file: $MV_HOME/remoting/midvision-remoting-server.xml

Change the port and multicast port to unused port numbers:

<resource type="port">20001</resource>
<resource type="multicast.port">4568</resource>

Configure Tomcat

The port settings that the tomcat server is running on will need changing, so there is not a conflict between instances. Edit the ports in the file: $MV_HOME/web-apps/tomcat/conf/server.xml

Change the server port and the connector port and any redirect ports. E.g:

<Server port="9006" shutdown="SHUTDOWN">
<Connector port="9091" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="9444" maxPostSize="0" />
<Connector port="9010" protocol="AJP/1.3" redirectPort="9044" maxPostSize="0" />

Change the Web Context or Rename the Session Cookie

If you have two instance of the framework server running on the same host using the same web context the the user from one instance will log out the same user in the second instance (if you are running in the same browser). This is because both instances of the application share the same browser JSESSIONID cookie.

One possible solution is to run each application in different contexts. The way to to this is to rename the file:

${MV_HOME}/web-apps/tomcat/webapps/MidVision.war

to:

${MV_HOME}/web-apps/tomcat/webapps/MyNewWebContext.war

and rename the directory (if it exists):

${MV_HOME}/web-apps/tomcat/webapps/MidVision

to:

${MV_HOME}/web-apps/tomcat/webapps/MyNewWebContext

With this solution the dual running framework server should now be accessible from the URL with a new port and new application context:

http://localhost:9091/MyNewWebContext

An alternative solution is to rename the application session cookie name in the file:

${MV_HOME}/web-apps/tomcat/conf/context.xml

Add the sessionCookieName attribute to the context xml.

<Context sessionCookieName="RD_DEV_JSESSIONID">

With this solution the dual running framework server should now be accessible from the URL with a new port:

http://localhost:9091/MidVision