This is archived documentation for an older version of Nirvana (v3.1). Please refer to documentation for the latest version if required.

How to to set up a HA failover cluster for Nirvana ?


Nirvana servers can be clustered together to form part of a single logical server. This can then be used to achieve HA (High Availability) etc.

For example if you want to set up a cluster running across two different machines with Realm1 running on host1.my-Channels.com and Realm2 running on host2.my-Channels.com.

Firstly, you create a cluster with Realm1 and Realm2. Then you create cluster channels and queues which ensures these objects exist in both servers.

For information on how to achieve this, please review the Nirvana Administration Tool guide.

The next step is to setup your clients so that they are configured to swap between Realm1 and Realm2 in case of failures.

When you initialise a client session with a Nirvana server you provide an array of RNAME urls as the argument to the nSessionAttributes object. This ensures that if you lose the connection to a particular Nirvana Realm, the session will be automatically reconnected to the next realm in the RNAME array.

Using the configuration above where cluster channels exists on each Realm, disconnected clients will automatically continue publishing/subscribing to the channel on the newly connected realm.

For example, to use the two Realms described above for failover you would use the following as your RNAME value using a comma separated list of individual RNAMES

RNAME=nhp://host1.my-Channels.com:80,nsp://host2.my-Channels.com:9000

If all subscribers and publishers are configured in this way then failover is provided in each of the following scenarios.

scenario: subscriber loses connection to a Realm

if a subscriber is consuming data from the sales channel on Realm1 and loses its connection it will automatically attempt to connect to its additional RNAMES (in this case nsp://host2.yourdomain:9000) and resume consuming from where it left off.

scenario: publisher loses connection to a Realm

If a publisher loses a connection to its Realm it will automatically reconnect to the alternative realm and continiue publishing there. For more information on HA configuration options please contact the my-Channels support team who will be happy to outline the pros and cons of the various HA configurations available.

scenario: publisher and subscriber are connected to different realms.

As channels on Realm1 and Realm2 are cluster channels events published to a sales channels on either Realm will be passed to sales channel on the other realm. As long as subscribers are consuming from a sales channel on one of the realms they will receive all events. Thus full guaranteed delivery is provided even if the publisher is publishing to Realm1 and subscribers are consuming from Realm2.