Contents
 Contents

Configuring HA in a FioranoMQ Server basically involves configuration of the modules below:

  • HA Layer
  • Admin Objects Store
  • Security Store
  • Message Store

The HA Layer configuration deals with the configuration of the Peer Server. The important configuration parameters defined in this layer are isPrimary (TRUE or FALSE), HA Port, Backup server's IP Address, Backup server's Client Port, and Backup server's HA Port. Configuration is required in both the Replication and the Shared HA mode. Additionally, Admin Objects Store, Security Store and Message Store must be configured for setting up Shared HA. When configuring HA, one of the following sets of instructions must be followed, depending on whether it is for Replication mode or for Shared mode.

Replication Mode
Step 1: Install FioranoMQ Servers
Step 2: HA Configuration

HA Shared Mode
Step 1: Install FioranoMQ Servers
Step 2: HA Configuration
Step 3: Admin Store Configuration
Step 4: Security Store Configuration
Step 5: Message Store Configuration

Configuring FioranoMQ HA in Replication mode is much easier, as the pre-created profiles are ready to be used; only the gateway IP needs to be modified. These profiles are pre-configured to demonstrate HA on a single machine. However, it is easy to setup HA on two different machines by configuring the HA Layer, as described below.

When setting up the server in Shared mode, in addition to setting up the HA Layer, the server configuration needs to be modified so as to point it to the Shared Admin Store, Security Store and Message Store. Instructions for these modifications can be found in Steps 3 to 5 in the sections below.

Step 1: FioranoMQ Server(s) Installation

The FioranoMQ Server(s) that forms the Enterprise Server can be installed on a single machine or on two separate machines, varying in hardware and/or software configuration. When setting up HA on a single machine, no changes are required; the default configuration (for primary and Secondary Server) is ready to be used. However, when setting up HA on different machines, the IP addresses of the Peer Servers have to be configured in the HA Layer. The following section provides step by step instructions for configuring the HA Layer.

Icon

The pre-created profile is configured to run HA on a single machine. Fiorano does not recommend setting up HA on just a single machine.

Step 2: HA Configuration

The HA Layer within a FioranoMQ server is responsible for creating a dedicated connection with the peer Backup Server. This dedicated connection is used for exchanging health and state information between peers being used. The following section provides details concerning the configuration of an HA Layer in a FioranoMQ Server and is applicable to both, Primary and Secondary Servers.

  1. Click on the Profile Manager pane and right-click the Profiles node. Select Open Profile from the pop-up menu and select the required profile. Click the Open button (%SELECTED_HA_PROFILE%) for offline editing, using the Profile Manager.
  2. Configure self HA port: This port refers to the port number on which the HA Layer accepts a connection from its Peer Server. The HA port of the default HA profiles configured for the Primary Server is 2000 while that of the Secondary Server is 3000. In order to modify these values, navigate to the node mentioned below, and change the port number in the PropertiesOf FioranoHAConnectionManager pane.

%SELECTED_HA_PROFILE% > Fiorano > HA > HAConnectionManager > FioranoHAConnectionManager

Icon

The screen-shot above shows the path for the HAConnectionManager node in Replication mode. The same path can be found when configuring the Connection Manager in Shared HA mode.

3. Configure the IP and HA port of the remote server: HA layer of a FioranoMQ Server connects to the Backup Server's HA layer. In order to configure the Backup Server's IP and its port, navigate to the node specified below, and set the values of BackupHAIPAddress and BackupHAPort displayed in the Properties of FioranoHAKRPCProvider pane.

%SELECTED_HA_PROFILE% > Fiorano > HA > HAKRPCProvider > FioranoHAKRPCObject

Icon

 

  • The screen-shot above shows the path for the HAKRPCProvider node in the Replication mode. The same path can be found while configuring HAKRPCProvider in the Shared HA mode.
  • The backup HA IP address of the default profiles is configured to localhost. Their backup HA port is configured to 3000 in the Primary Server and to 2000 in the Secondary Server. In other words, by default, the Primary Server's HA layer tries to connect at localhost on port 3000, while the Secondary's HA Layer tries to connect to a localhost on port 2000. 
  • The BackupHA port here does not refer to the port on which the Backup Server accepts client connections, but to the port on which it's HA Layer listens. The value here should be the same as the value of HAConnectionManager's port, configured in the Peer Server.

 

4. Configure Gateway Server: HA Layer pings the gateway machine to determine the status of the network connectivity. The default profiles have Gateway configured to localhost and should be changed to a third independent reliable machine (preferably to the physical router machine on the network). In order to configure Gateway Server, navigate to the node specified below, and modify the value of GatewayServerIPAddress and GatewayServerPort in the Properties of FioranoHAManager pane.

%SELECTED_HA_PROFILE% > Fiorano > HA > FioranoHAManager

Icon

The screen-shot above shows the path for the FioranoHAManager node in the Replication mode. This path can be found when configuring FioranoHAManager in the Shared HA mode.

5. Configure Primary: Enable the Primary property for the Primary FioranoMQ Server and disable the Backup Server by modifying its value by clicking the node specified below:

%SELECTED_HA_PROFILE% > Fiorano > HA > HAManager > FioranoHAManager

Icon

The screenshot above shows the path for the FioranoHAManager node in the Replication mode. This path can be found when configuring FioranoHAManager in the Shared HA mode.


6. Common Configuration: HA requires enabling Durable Connections, Pinging and Auto Revalidation support in the FioranoMQ Server. This can be done by navigating to and modifying the parameters specified below, located in the properties pane.

%SELECTED_HA_PROFILE% > Fiorano > etc > FMQConfigLoader

 

Enable the properties below:

 

  • AllowDurableConnections
  • PingEnabled
  • EnableAutoRevalidation

Icon

The screen-shot above shows the path for HAManager node in the Replication mode. This path can be found when configuring HAManager in the Shared HA mode. Pre-created profiles are set to this configuration, and require no change when working with them.

7. Configure the Backup Server's IP and Port: Specify the BackUpServerIP and BackupServerPort used by clients in the event of a connection failure. This IP Port should refer to the backup FioranoMQ Server's IP Address and to the Port on which it accepts client connections. This is done by navigating to the node specified below, and modifying the Backup Server's IP address and the Backup Server's port parameters within the Properties of the MQDefObjCreater pane.

%SELECTED_HA_PROFILE% > Fiorano > etc > MQDefObjCreater

8. The FioranoMQ Server uses these parameters to set a Backup Server URL in the default connection factories. For client connections to fail-over, it is important that the Backup Server URL is properly configured. If the configuration is changed for the default connection factories, the database should be recreated, or a self-created connection factories database with correct URLs should be used.

The IP address of the default profiles is configured for localhost, for Primary and Secondary Servers. The backup port is configured to 1956 in the Primary Server and to 1856 in the Secondary Server. 

Icon

In the default profile, the Secondary Server accepts client connections on port 1956, and the Primary Server accepts client connections on port 1856.

Icon

The screenshot above shows the path for the MQDefObjCreater node in the Replication mode. This path can be found when configuring HAManager in the Shared HA mode.

9. Right-click the %SELECTED_HA_PROFILE% root, and select the Save option from the pop-up menu to save this configuration.

Example Configuration

Parameter

Primary Server

Backup Server

URL

http://164.164.129.128:1856

http://164.164.129.108:1956

HAKRPCProvider

BackupHAIPAddress

164.164.129.108

164.164.129.128

BackupHAPort

3000

2000

HAConnectionManager

 

 

Port

2000

3000

Common Config

Backup IP Address

164.164.129.108

164.164.129.128

Port

1956

1856

EnableDurableConnections

Yes

yes

PingEnabled

Yes

yes

HAManager

isPrimary

Yes

no

Gateway IP Address

164.164.129.225

164.164.129.225

10. After changing the HA Layer's configuration, clear the server's existing database prior to re-starting the server. The existing Data Store can be cleared by executing the ClearDB script in fmq/bin folder of the installation directory, with the profile name as an argument.

For example:

  • clearDb FioranoMQ_HA_rpl/HAPrimary
  • clearDb FioranoMQ_HA_shared/HAPrimary

These are required to re-create connection factories to include the backup of the IP address of the Peer Server. If clearing the entire Data Store is not possible, use only newly created connection factories for HA enabled applications.

Configuring FioranoMQ Replicated HA

  • To use Replicated HA, open FioranoMQ_HA_rpl/HAPrimary, and open the FioranoMQ_HA_rpl/HASecondary profile in the eStudio Profile Manager. Right-click on the profile, and select FMQ Replicated HA. The FMQ Replicated HA wizard appears.

  • All required values can be configured using the wizard. After configuration, right-click on the node, and select the Save option from the pop-up menu.


The properties listed below are available in the FMQ Replicated HA wizard.

BackupServerIp
This IP represents the URL of FioranoMQ Backup Server. In the event of server failure, the server clients connect to the Backup Server.

BackupServerPort
This port represents the Backup Server port on which the Backup FioranoMQ Server runs.

BackupHAIPAddress
This IP represents the URL where another FioranoMQ HA Server runs. In the event of a failure of this HA Server, all the required synchronized data is available in the Backup HA Server. Here the HA Layer connects to the Backup HA Server.

BackupHAPort
This port represents the backup machine HA port on which another FioranoMQ Server can run.

Port
This port represents the FioranoMQ Server's HA port on which the HA Server runs.

PingInterval
This interval represents the time period, after which, the HA Server pings the HA Backup Server to determine if the server is running properly.

GatewayServerIPAddress
This value represents the IP address of the third machine present in the network. This value must not represent the machine on which the FioranoMQ Server runs.

GatewayServerPort
This value represents the port to which the HA Server pings. This port can be used only for this function.

ActiveLockAcquisitionInterval:
This parameter indicates the wait interval between each attempt to acquire the lock for Active Server. This value should be in multiples of half of the PingInterval value (PingInterval / 2). Otherwise, the server can try to acquire the lock on the next multiple of pingInterval/2.

PassiveLockAcquisitionInterval:
This parameter indicates the wait interval for the Passive Server to acquire the lock when the link between active and Passive Server is down. This value should be greater than twice the value of the ActiveLockAcquisitionInterval, that is, 2 * ActiveLockAcquisitionInterval, or an exception will be thrown. The server will not start if this value is not set properly.

All IP addresses and ports should represent the correct values. Even without the modification of any of the values, the HA Primary Server and the HA Secondary Server can run on a single machine.

For example, if the HA Primary Server is running on a machine with IP Address 192.169.1.157., and the HA Secondary Server, on a machine with IP Address 192.169.1.159., the Gateway server address is given as 192.169.1.159. After configuration, the HA Primary Server the wizard should display the values, as shown in the figure below:

After configuration of the HA Secondary Server, the wizard should display the values, as shown in the figure below:

Configuring FMQ Shared HA

  • If a Shared HA needs to be used, open the FioranoMQ_HA_shared/HAPrimary and the FioranoMQ_HA_shared/HASecondary profiles in the eStudio Profile Manager. Right-click on the profile, and click on FMQ Shared HA to display the FMQ Shared HA wizard.

  • All required values can be configured using the wizard. Upon completing configuration, right-click the node, and select the Save option from the pop-up menu.

The following properties are available in the FMQ HA Replicated wizard.

BackupServerIp
This IP represents the URL where the FioranoMQ Backup Server runs. In the event of a server failure, clients connect to the Backup Server.

BackupServerPort
This port represents the backup machine server port on which the Backup FioranoMQ Server runs.

BackupHAIPAddress
This IP represents the URL of the additional FioranoMQ HA Server. In the event that this HA Server fails, all required synchronized data is available in the Backup HA Server and HA Layer that connects to Backup HA Server.

BackupHAPort
This port represents the Backup machine HA port on which another FioranoMQ Server runs.

Port
This port represents the FMQ server HA port on which the HA Server runs.

PingInterval
This interval represents the duration within which the HA Server pings the HA Backup Server to determine whether the server is running.

GatewayServerIPAddress
This value represents the IP address of the third machine that is always present in the network. This value must not represent the machine on which the FioranoMQ Servers run.

GatewayServerPort
This value represents the port where the HA server pings. This port cannot be used for another purpose.

ActiveLockAcquisitionInterval:
This parameter indicates the wait interval between each attempt to acquire the lock for Active Server. This value should be in multiples of half of the PingInterval value (PingInterval / 2). Otherwise, the server may try to acquire the lock on the next multiple of this value

PassiveLockAcquisitionInterval:
This parameter indicates the wait Interval for the Passive Server to acquire the lock when the link between active and Passive Server is down. This value should be greater than '2*ActiveLockReacquisitionInterval', otherwise an exception will be thrown. The server will not start if this value is not set properly.

All IP addresses and ports should represent the correct values. Even without the modification of any of the values, the HA Primary Server and the HA Secondary Server are able to run on a single machine.

For example in running the HA Primary Server on a machine with IP Address: 192.169.1.157 and the HA Secondary Server on a machine with IP Address: 192.169.1.159, the Gateway Server is given as 192.169.1.159 which is present in the network. After configuration, the HAPrimary wizard looks as shown below:

The HA Secondary wizard displays:

Step 3: Configuring Admin Store

To configure Admin Store, decide on the type of Shared Admin Object Store to be used with the FioranoMQ Server. Choose from the options given below:

  • File Based (Fiorano's proprietary file format ) – default option
  • RDBMS Server
  • XML File
  • LDAP Server

Fiorano recommends the RDBMS or LDAP Server, as per instructions provided in Chapter 3 Naming Manager.

Icon

If the default implementation or xml-based implementation in Shared HA mode is used, the path attribute for the Naming Manager Server should point to the same physical location. This requires mapping a drive locally on the machine, given that both servers that are a part of the Enterprise Server are running on separate machines.

Step 4: Configuring Common Security Store

The FioranoMQ Security Realm can be categorized into two domains.

  • Principal – user management
  • ACL – Access Control List

The FioranoMQ Server provides a pluggable component for both the above domains. These components, namely, the Principal Manager and ACL Manager, provide user management and ACL Management services to the server respectively. Both of these components require a data Store in order to store the security information that they manage.
The options for storage media are:

  • File Based (Fiorano's proprietary file format) – default option
  • RDBMS Server
  • XML File
  • LDAP Server

When configuring a FioranoMQ Server in HA Shared mode, the Data Store used by both the servers (in an Enterprise Server) should point to the same physical location. When setting up the Enterprise Server, it is recommended that an RDBMS or an LDAP server be used as the store for security managers.

Icon

Instructions for configuring Security Realms to use the above types of storage media can be found in the Chapter 5 FioranoMQ Security
If using default implementation or xml-based implementation in Shared HA mode, the path attribute for the Principal Manager or the ACL Manager should point to the same physical location. This requires mapping a drive locally on a machine, given that servers that are part of the Enterprise Server are running on separate machines.

Step 5: Configuring Database

For storing messages, the FioranoMQ Server provides the option of using either an RDBMS server or a file based database. When using an Enterprise Server, both of the servers are required to point to the same database (RDBMS or File Based).
Instructions for configuring both types of databases are given below.
RDBMS Server:

Icon

Refer to Chapter 6 Configuring Message Store for instructions on setting up a single instance of FioranoMQ so as to use an RDBMS Server as the back-end message store. 

Instructions for several commonly used databases are provided. When setting up an Enterprise Server, configure both the server instances with the same set of database parameters. When using an RDBMS Server, ensure that the Data Store of the destination being used as RDBMS is specified, instead of the default File-based Data Store.

File Based DataStore

In the default mode, FioranoMQ creates a proprietary file-based database for storing messages. This database is created by default in the run folder of the profile being used.
For example, in the default profile, the database directory can be navigated to, using the path below:

Within an Enterprise Server, both of the servers should have their databases pointing to the same physical directory. The database directory can be specified through the command line option –fmq.db.path when running the server. For example, assuming that a shared database is to be created in \fmq-db directory, the command line to launch both the servers would be:

Icon

 If both servers are to run on separate machines, the database directory must be made available to both of the machines by mapping the drive locally.

Adaptavist ThemeBuilder EngineAtlassian Confluence