Installing the First Server

Install the first server for a high availability (active-active) implementation as follows:

  1. Create an Oracle or SQL Server database on a separate machine. See Preparing Your Database.
  2. Install the first Deployment Automation server. This installs a profile into the designated installation folder, which by default is the following:

    ../Users/userName/.serena/ra

    This profile will be shared with subsequent server installations. Ensure that the installation folder can be accessed by all the machines on the active-active cluster.

    See Server Installation.

  3. Update the Hibernate cache properties in the installation properties file as follows:
    1. Open the Deployment Automation shared user profile installed.properties file. The default path is as follows:

      ../Users/userName/.serena/ra/conf/server/installed.properties

    2. Disable the Hibernate query cache property as follows:

      hibernate.cache.use_query_cache=false

      Note: For increased I/O throughput, query caching is used by default. However, the Hibernate cache must be disabled in active-active configurations, because it doesn't work across multiple server instances.
    3. Enable the Hibernate second level cache property as follows:

      hibernate.cache.use_second_level_cache=true

    4. Change the following line. This references the cache file you will create in the next step.

      net.sf.ehcache.configurationResourceName=ehcache-active-active.xml

  4. Create a cache properties file for your active-active servers as follows:
    1. Copy and paste the following into a new file called ehcache-active-active.xml.
      <ehcache updateCheck="false">
      <diskStore path="java.io.tmpdir" />
      <cacheManagerPeerProviderFactory 
       class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory" 
       properties="peerDiscovery=manual, 
       rmiUrls=//<ip_server1>:<port>/deployServerCache|
       //<ip_server1>:<port>/securityServerCache|
       //<ip_server1>:<port>/vcCache|
       //<ip_server1>:<port>/org.hibernate.cache.internal.StandardQueryCache|
       //<ip_server1>:<port>/org.hibernate.cache.spi.UpdateTimestampsCache|	
       //<ip_server1>:<port>/defaultCache|
       //<ip_server2>:<port>/deployServerCache|
       //<ip_server2>:<port>/securityServerCache|
       //<ip_server2>:<port>/vcCache|
       //<ip_server2>:<port>/org.hibernate.cache.internal.StandardQueryCache|
       //<ip_server2>:<port>/org.hibernate.cache.spi.UpdateTimestampsCache|	
       //<ip_server2>:<port>/defaultCache" />
      <cacheManagerPeerListenerFactory
       class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
       properties="port=<port>, socketTimeoutMillis=200000"/>
      <cache name="deployServerCache" 
       maxElementsInMemory="10000" 
       eternal="false" 
       timeToLiveSeconds="86400" 
       overflowToDisk="true"
       maxElementsOnDisk="100000" 
       diskPersistent="true" 
       diskExpiryThreadIntervalSeconds="86400" >
       <cacheEventListenerFactory
       class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"/>	
      </cache>	
      <cache name="securityServerCache" 
       maxElementsInMemory="10000" 
       eternal="false" 
       timeToLiveSeconds="86400" 
       overflowToDisk="true"
       maxElementsOnDisk="100000" 
       diskPersistent="true" 
       diskExpiryThreadIntervalSeconds="86400" >
       <cacheEventListenerFactory
       class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"/>	
      </cache>	
      <cache name="vcCache" 
       maxElementsInMemory="10000" 
       eternal="false" 
       timeToLiveSeconds="86400" 
       overflowToDisk="true"
       maxElementsOnDisk="100000" 
       diskPersistent="true" 
       diskExpiryThreadIntervalSeconds="86400" >
       <cacheEventListenerFactory
       class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"/>	
      </cache>	  
      <cache name="org.hibernate.cache.internal.StandardQueryCache"
       maxElementsInMemory="10000" 
       eternal="false" 
       timeToLiveSeconds="86400" 
       overflowToDisk="true"
       maxElementsOnDisk="100000" 
       diskPersistent="true" 
       diskExpiryThreadIntervalSeconds="86400" >
       <cacheEventListenerFactory
       class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"/>	
      </cache>
      <cache
       name="org.hibernate.cache.spi.UpdateTimestampsCache"
       maxEntriesLocalHeap="10000"
       eternal="true">
       <cacheEventListenerFactory
       class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"/>	
      </cache>
      <defaultCache 
       maxElementsInMemory="10000" 
       eternal="false" 
       timeToLiveSeconds="86400" 
       overflowToDisk="true"
       maxElementsOnDisk="100000" 
       diskPersistent="true" 
       diskExpiryThreadIntervalSeconds="120" >
       <cacheEventListenerFactory
       class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"/>	
      </defaultCache>	
      </ehcache>
    2. Save the file to the Deployment Automation shared user profile server directory. For example:

      ../Users/userName/.serena/ra/conf/server/ehcache-active-active.xml

    3. Search for the rmiUrls property. In that property, modify and add lines for server IP addresses and port to match those for the servers and port you are using in your active-active configuration.

      In the following example, the first server is 10.136.40.114 and the second server is 10.136.40.250. The port is 40001.

      <cacheManagerPeerProviderFactory
       class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
       properties="peerDiscovery=manual,
       rmiUrls=//10.136.40.114:40001/deployServerCache|
       //10.136.40.114:40001/securityServerCache|
       //10.136.40.114:40001/vcCache|
       //10.136.40.114:40001/org.hibernate.cache.internal.StandardQueryCache|
       //10.136.40.114:40001/org.hibernate.cache.spi.UpdateTimestampsCache| 
       //10.136.40.114:40001/defaultCache|
       //10.136.40.250:40001/deployServerCache|
       //10.136.40.250:40001/securityServerCache|
       //10.136.40.250:40001/vcCache|
       //10.136.40.250:40001/org.hibernate.cache.internal.StandardQueryCache|
       //10.136.40.250:40001/org.hibernate.cache.spi.UpdateTimestampsCache| 
       //10.136.40.250:40001/defaultCache" />
      
    4. Save the file.
  5. Update the Serena Common Tomcat set environment file as follows:
    1. Navigate to the Serena Common Tomcat path bin directory. For example:

      C:\Program Files\Serena\common\tomcat\8.0\bin

    2. Edit setenv.bat for Windows or setenv.sh for Unix/Linux.
    3. Find the line JAVA_OPTS=... for Windows or CATALINA_OPTS=... for Unix/Linux and add the following property to it:

      -Djava.rmi.server.hostname=<ip_server1>

      where <ip_server1> is the IP address of this first server

    4. Restart Serena Common Tomcat.
  6. Share the directory where the Deployment Automation profile is stored. Configure proper access to its content for network clients. To share the profile location, use the following guidelines:
    • The shared network storage should not reside on any of the Deployment Automation servers; otherwise it introduces a dependency on one node always being available and invalidates High Availability principles.

    • Shared storage should be accessed using a symbolic directory link or mapped drive created on each of the Deployment Automation servers.

      CAUTION:
      If you use a UNC path on Windows, you cannot run Deployment Automation as a service. Instead, use a mapped drive.
    • The Tomcat service on each of the Deployment Automation servers needs to be configured to run using a domain service account. That account must be given full access to the following:

      • The shared network location
      • The Deployment Automation and Tomcat installation directories on each Deployment Automation server
  7. In the Deployment Automation user interface for this first server, create a network relay for each server that is part of your active-active configuration.
    1. In the Deployment Automation user interface, navigate to Management > Resources.
    2. In the selection box, select Relays.
    3. Click the Relay Actions button and then select Create Network Relay.
    4. In the Create Network Relay dialog, enter a Name for the server.
    5. In the Host field, enter ip_servern, where ip_servern is the IP address of server 1 (this server) through n. This is the remote hostname or IP address to which current server will connect.
    6. Enter the JMS Port number, such as 7918, that the current server will use to connect to another server using the network relay.
    7. Select the Active check box to tell the server to start the connection with another server using the network relay.
    8. Click Save.
    9. Repeat this process for each server.
  8. If you are connecting the agents to a single endpoint, with your Deployment Automation servers defined as a cluster with a load balancer, do the following:
    1. In the first server installed in your active-active installation, in the Deployment Automation user interface, navigate to Administration > System.
    2. Select System Settings in the selection box.
    3. Modify the External Agent URL and External User URL fields to use the IP address or the DNS name and port of the load balancer server.