- Rename procrun.exe to the name you want the service to run as, I used OAMSessionFailover.exe. (Note: you may need to copy the correct binary version from the subdirectory for 64 bit exes)
 - Rename prunsvc.exe to the name you want the service to run as, I used OAMSessionFailoverw.exe Note: no special binary version for 64 bit OSes)
 - Make sure that JAVA_HOME and JRE_HOME environment variable is set.
 - I found that using host names rather than virtual DNS entries works better for the cluster list
 - Configure/Install the Apache Commons Daemon service by doing the following (replace anything in italics with your values):
 - set SERVICE_NAME="OAMSessionFailover"
 - set "EXECUTABLE=C:/SessionFailover/bin/OAMSessionFailover.exe"
 - set "PR_DESCRIPTION=OpenAM Session Failover Services"
 - set "PR_INSTALL=%EXECUTABLE%"
 - set "PR_LOGPATH=C:/SessionFailover/logs"
 - set "JMQ_INSTALL_DIR=C:/OpenAM-10.0.0/tools/ssoSessionTools/jmq/imq"
 - set "PR_CLASSPATH=%JMQ_INSTALL_DIR%/lib/imq.jar;%JMQ_INSTALL_DIR%/lib/jms.jar C:/OpenAM-10.0.0/tools/ssoSessionTools/ext/je.jar;C:/OpenAM-10.0.0/tools/ssoSessionTools/locale;C:/OpenAM-10.0.0/tools/ssoSessionTools /lib/am_sessiondb.jar;."
 - set "PR_JVM=%JRE_HOME%\bin\server\jvm.dll"
 - set JAVA_CMD_OPTIONS=-a;cluster_list;-u;user_name;-f;passwordfile;-b;database_dir; AMSESSIONDB_ARGS;-m; C:/OpenAM-10.0.0/tools/ssoSessionTools/sfoscripts/config/lib/amsfo.conf
 - "%EXECUTABLE%" //IS//%SERVICE_NAME% --StartClass com.sun.identity.ha.jmqdb.client.FAMHaDB --Startup=auto --StartMethod=main --StartParams="%JAVA_CMD_OPTIONS%" --StartMode=jvm
 - . Configure the Message Broker Service by doing the following (replace anything in italics with your values):
 - set IMQSVCADMIN_OPTIONS=-name broker_instance_name -port broker_port -cluster cluster_list
 - %JMQ_INSTALL_DIR%\bin\imqsvcadmin.exe install -vmargs "-Xms256m -Xmx512m" -args "%IMQSVCADMIN_OPTIONS%"
 - The message queue must start before the session failover service so do the following to tell Windows that the dependency exists:
 - sc config OAMSessionFailover depend= Tcpip/Afd/MQ4.4_Broker
 - Start the services
 - sc start MQ4.4_Broker
 - sc start OAMSessionFailover
 - Configure OpenAM to use session failover
 - set FAILOVER_CONF_FILE="session-failover-subconfig-attributes.txt"
 - >%FAILOVER_CONF_FILE% (
 - echo iplanet-am-session-jdbc-url=cluster list(host:7777,host2:7777)
 - echo iplanet-am-session-sfo-enabled=true
 - echo iplanet-am-session-store-cpl-max-wait-time=5000
 - echo iplanet-am-session-store-password=password
 - echo iplanet-am-session-store-username=user
 - )
 - ssoadm create-sub-cfg --servicename iPlanetAMSessionService --subconfigname sitename --subconfigid Site --priority 0 -D "%FAILOVER_CONF_FILE%" –u amadmin –f passwordfile.txt (Make sure subconfigname is you site name – it must match exact!!)
 - This does not shutdown the process cleanly because there is no way to get to the private method that shuts down the session db (Unless you wite a hack class that makes the method public and call it that is! :)
 
Tuesday, November 26, 2013
Configuring OpenAM Session Failover to run as a Windows Service
In hopes of saving people many hours of frustration I am documenting here what I did in order to get OpenAM session failover to run as a Windows Service rather than as a perl script (amsfo.pl).  I did this so if/when the server restarts the session failover service will automatically restart.  
First, follow the instruction here - https://wikis.forgerock.org/confluence/display/openam/5+Extending+to+a+Dual+Instance+Deployment up to "Activating Session Failover".  You will need to download and install Apache Commons Daemon, http://commons.apache.org/proper/commons-daemon/, and install/copy it to a directory where you want to reference it.
Now the fun starts:
Subscribe to:
Comments (Atom)


