Launching the servers
While launching the Enterprise Server, the launch sequence within the two servers is not important. Either server (primary or backup) can be started first. On start up, the servers establish a communication path between each other in order to exchange information regarding proper functioning of all servers. The servers can be launched by using the fmq (bat/sh) script (available in the fmq/bin directory of the installation package), and supplying the %SELECTED_HA_PROFILE% as an argument. Different methods to run HA profiles are described here.
Console
Windows:
When launching the Primary HA Server in Replicated Mode, the command line would be:
For Secondary HA server in Replicated Mode, the command line would be:
Unix:
When launching the Primary HA Server in Replicated Mode, the command line would be:
For Secondary HA server in Replicated Mode, the command line would be:
Background
Unix:
When launching the Primary HA Server in Replicated Mode, the command line would be:
For Secondary HA server in Replicated Mode, the command line would be:
Service
HA replicated profiles can be made to run as service. Detailed procedure based on platform is provided here.
Windows:
Any profile present under %FMQ_DIR%/profiles can be made to run as NT service.
Steps for installing HA profile as NT Service:
- Open a command prompt
- Goto to %FMQ_DIR%\bin\service directory
- To install FioranoMQ Kernel as NT service, run one of the commands below:
install-fmq-service.bat -profile FioranoMQ_HA_rpl/HAPrimary
install-fmq-service.bat -profile FioranoMQ_HA_rpl/HASecondary
- After installation you should be able to see "FioranoMQ <%PROFILE_NAME%>" NT service installed.
- Start the NT Service. Logs for NT service run can be viewed in the %FMQ-DIR%\bin\service\logs%PROFILE_NAME%.log file.
Linux:
For enabling Replicated HA profiles as service, there is a script "fmq-linux" available in fmq/bin/service directory of FioranoMQ installation directory. Follow the procedures listed here:
- Set JAVA_HOME at line 8.
- Set the FIORANO_HOME at line 10.
- fmq-linux by default runs FioranoMQ Profile, to run Primary profile change the name of the profile on line 20 to FioranoMQ_HA_shared/HAPrimary. To run Secondary profile, change the name of the profile on line 20 to FioranoMQ_HA_shared/HASecondary.
- Give Executable Permission, "chmod +x fmq-linux".
- To start as a service, type "./fmq-linux start".
- To stop the server, type "./fmq-linux stop".
- To run this as a service with system startup, type "chkconfig --add fmq-linux". This will launch the service whenever the system is started.
SOLARIS:
For enabling Replicated HA profiles as service, there is a script "fmq-solaris" available in fmq/bin/service directory of FioranoMQ installation directory. Follow the procedures listed here:
- Set the FIORANO_HOME at line 9 of fmq-solaris file.
- fmq-solaris by default runs FioranoMQ Profile, to run Primary profile change the name of the profile on line 19 to FioranoMQ_HA_rpl/HAPrimary. To run Secondary profile, change the name of the profile on line 19 to FioranoMQ_HA_rpl/HASecondary.
- Copy the file fmq-solaris in "/etc/init.d".
- Give Executable Permission, "chmod +x fmq-solaris".
- To start as a service, type "./fmq-solaris start".
- To stop the server, type "./fmq-solaris stop".
- To run this as a service with system startup create the links from "/etc/init.d" using the following commands
To start the service at startup:
Note: If the priority level '86' which is specified in the link already exists in the run level (rc3.d), then select a number which doesn't exist there.
Example: If you want to set the priority 71 then create the link using the following command in "/etc/init.d"
ln -s fmq-solaris /etc/rc3.d/S71fmq-solaris
- Set JAVA_HOME in <FIORANO_HOME>/fiorano_vars.sh
Note: Even if the JAVA_HOME is set in the .bashrc or .bash_profile, it won't be configured at startup. So JAVA_HOME must be set in "fiorano_vars.sh" script file.
Stopping the servers
Console
Windows:
When stopping the Primary HA Server in Replicated Mode with RMIPort 1858, the command line would be:
For Secondary HA server in Replicated Mode with RMIPort 1859, the command line would be:
Note: For shutting down both the Primary and Secondary HA servers in a single request, the command line would be: shutdown-fmq.bat -rmiPort 1858 -ha
This will send a "Shutdown" request to the backup server first and then shuts down the primary server. Any errors during the execution will be logged on to the console.
Unix:
When stopping the Primary HA Server in Replicated Mode with RMIPort 1858, the command line would be:
For Secondary HA server in Replicated Mode with RMIPort 1859, the command line would be:
Note: For shutting down both the Primary and Secondary HA servers in a single request, the command line would be: ./shutdown-fmq.sh -rmiPort 1858 -ha
This will send a "Shutdown" request to the backup server first and then shuts down the primary server. Any errors during the execution will be logged on to the console.
Background
Unix:
When stopping the Primary HA Server in Replicated Mode with RMIPort 1858, the command line would be:
For Secondary HA server in Replicated Mode with RMIPort 1859, the command line would be:
Note: For shutting down both the Primary and Secondary HA servers in a single request, the command line would be: ./shutdown-fmq.sh -rmiPort 1858 -ha
This will send a "Shutdown" request to the backup server first and then shuts down the primary server. Any errors during the execution will be logged on to the console.
Service
Windows:
To remove FioranoMQ Kernel NT service, run the command
Un-Install should stop and remove NT service for given profile from the services list.
Linux:
To remove initially created service type "chkconfig --del fmq-linux". This will remove the previously added service
SOLARIS:
To stop the service at shutdown/reboot type:
Note: It is recommended to choose low priority level for shutdown.
Determining status of servers
It is easy to determine the status of server while running through console, as status of servers are printed on console. It can also be determined by running ServerStatus.java file available in fmq/samples/JMX directory of FioranoMQ installation directory. Details about running this file are available in readme file in the same directory.
Log details
Just like the base FioranoMQ server, the HA server can log into files, consoles, or use any other custom-made logger. The type of logging is controlled through the Loggers module in Fiorano Studio. Options to log all information on the console or save all logs into a log or error file, is provided through Console-based and File-based logging respectively.
Verifying HA Setup
On starting the Fiorano MQ Server that is part of an HA pair, the server prints debug information about its own state (ACTIVE, PASSIVE, and WAITING). It also prints information about its backup server's state whenever it detects a change.
Example Statements on console:
The Console includes statements as shown below:
'Primary Server switched to ACTIVE' or 'Secondary Server switched to PASSIVE', which indicate that the pair has successfully connected. Also, a statement gets printed when the lock is successfully acquired over the LockFile on the active servers console.
Example: Successfully acquired lockon:C:\lockFile.dat.
The figure below illustrates a successfully started Fiorano HA MQ Server: