When performing the changerole from Desktop Client, the Primary or active server may stop and show error like:
20170919 ...... [hac] [INFO] RMI TCP Connection(123456)-10.XX.XX.XX: [2017-09-19 ..... ] Peer server cannot be found via RMI. Cannot Change Roles.
The 'Peer server cannot be found via RMI' error can result due to timeouts. When the primary server tries to changerole, it will contact the standby via RMI.
The DE requires the RMI ports be open between Primary and Standby server. The default ports are 7599 and 7598. If there is a network issue the changerole can get interrupted.
If the Primary and Standby are on two separate subnets, then make sure all the necessary ports are open. It is very important that the network latency is very low (below 25ms).
You may also add a debug statements in the DE side to get more information on the timeouts. The following two statements may be added in the DE startServer script in Linux/UNIX or windows.service.properties in Windows.
-Djava.rmi.server.logCalls=true
-Dsun.rmi.server.logLevel=VERBOSE
Linux/UNIX
The startServer is located in <install_directory>/bin. In the file, locate ARGS=. Add the above two properties to the end of the line, separated by a space. E.g.
ARGS=" -Xms${MIN_HEAP_SIZE}m -Xmx${MAX_HEAP_SIZE}m -Duser.dir=${CAWA_HOME} -Dserver.pidfile=${PID_FILE} -Duser.language=en -Dlog4j.configuration=file:///${CAWA_HOME}/conf/server.log4j.xml -Dlog.directory=${CAWA_HOME}/logs -Dlax.root.install.dir=${CAWA_HOME}/ -Dlog4j.configuratorClass=com.cybermation.espresso.log.LogConfigurator -Djava.rmi.server.logCalls=true -Dsun.rmi.server.logLevel=VERBOSE"
Note: Backup the files before editing. The new properties will take affect after DE restart. Remove the above properties once the debugging has been completed.
After the restart, check stdout.txt file for detailed RMI related messages.
Nov 27, 2017 11:11:40 AM sun.rmi.server.UnicastRef invoke
FINER: HAC: method: public abstract void com.ca.wa.comp.highavailability.HacFacade.ping() throws java.rmi.RemoteException
Windows
The windows.service.properties is in <install_directory>/conf. Add the debug properties under JVM Properties with correct number sequence and restart.
jvmproperty_11=-Djava.rmi.server.logCalls=true
jvmproperty_12=-Dsun.rmi.server.logLevel=VERBOSE
Note: Backup the files before editing. The new properties will take affect after DE restart. Remove the above properties once the debugging has been completed.
Check the errors.txt and tracelog for RMI related messages.