Contents

Shared HA

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 runContainer script (available in the fmq/bin directory of the installation package), and supplying the %SELECTED_HA_PROFILE% as an argument.

In order to run shared HA profiles we need to specify dbPath as extra command line argument. This is the path where run folder will be created and this must be pointing to the same directory for both the profiles (Primary and Secondary). It would be better if this shared db is on third machine (other than machines where Primary and Secondary profiles are running). For sharing db from third machine, use same method as specified for sharing LockFile. Different methods to run HA profiles are described here. It is supposed that shared db is mounted, for Primary server, on /home/fmq1/shared for Linux machine ( C:\fmq1\share on Windows machine) and, for Secondary server, /home/fmq2/shared on Linux machine ( C:\fmq2\share on Windows machine).

Console

Windows:
When launching the Primary HA Server in shared Mode, the command line would be:


For Secondary HA server in shared Mode, the command line would be:


Unix:
When launching the Primary HA Server in shared Mode, the command line would be:


For Secondary HA server in shared Mode, the command line would be:

 

Background

Unix:
When launching the Primary HA Server in shared Mode, the command line would be:


For Secondary HA server in shared Mode, the command line would be:

 

Service

Windows
Any profile present under %FMQ_DIR%/profiles can be made to run as NT service.
Steps for installing HA profile as NT Service:

  1. Open a command prompt
  2. Goto to %FMQ_DIR%\bin\service directory
  3. To install FioranoMQ Kernel as NT service, run one of the commands below:
    1. install-fmq-service.bat -profile FioranoMQ_HA_shared/HAPrimary
    2. install-fmq-service.bat -profile FioranoMQ_HA_shared/HASecondary
  4. After installation you should be able to see "FioranoMQ <%PROFILE_NAME%>" NT service installed.
  5. Start the NT Service. Logs for NT service run can be viewed in %FMQ-DIR%\bin\service\logs%PROFILE_NAME%.log.

Linux:

For enabling Shared 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:

  1. Set JAVA_HOME at line 8.
  2. Set the FIORANO_HOME at line 10.
  3. 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..
  4. Give Executable Permission, "chmod +x fmq-linux".
  5. To start as a service, type "./fmq-linux start".
  6. To stop the server, type "./fmq-linux stop".
  7. 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 Shared 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:

  1. Set the FIORANO_HOME at line 9 of fmq-solaris file.
  2. 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.
  3. Copy the file fmq-solaris in "/etc/init.d".
  4. Give Executable Permission, "chmod +x fmq-solaris".
  5. To start as a service, type "./fmq-solaris start".
  6. To stop the server, type "./fmq-solaris stop".
  7. 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"


To stop the service at shutdown/reboot:


It is recommended to choose a low priority level for shutdown

Set JAVA_HOME in <FIORANO_HOME>/fiorano_vars.sh

Even if JAVA_HOME is set in the .bashrc or .bash_profile, it won't get configured at startup.

So JAVA_HOME must be set in the fiorano_vars.sh script file.

Stopping the servers

Console

Windows:

When stopping the Primary HA Server in shared Mode with RMIPort 1858, the command line would be:


For Secondary HA server in shared Mode with RMIPort 1859, the command line would be:


Unix:
When stopping the Primary HA Server in shared Mode with RMIPort 1858, the command line would be:


For Secondary HA server in shared Mode with RMIPort 1859, the command line would be:

 

Background

Unix:
When stopping the Primary HA Server in shared Mode with RMIPort 1858, the command line would be:


For Secondary HA server in shared Mode with RMIPort 1859, the command line would be:

 

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:
ln -s fmq-solaris /etc/rc3.d/K45fmq-solaris

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.

Verify 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 ACTIVATING). 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 in shared mode:

Adaptavist ThemeBuilder EngineAtlassian Confluence