blob: 6dff04d34ec3db1baacb40730d09b2982ef88227 [file] [log] [blame]
---
title: Configuring Highly Available Servers
---
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<a id="configuring_highly_available_servers__section_7EB2A7E38B074AAAA06D22C59687CB8A"></a>
With highly-available servers, one of the backups steps in and takes over messaging with no interruption in service if the client's primary server crashes.
To configure high availability, set the `subscription-redundancy` in the client's pool configuration. This setting indicates the number of secondary servers to use. For example:
``` pre
<!-- Run one secondary server -->
<pool name="red1" subscription-enabled="true" subscription-redundancy="1">
<locator host="nick" port="41111"/>
<locator host="nora" port="41111"/>
</pool>
```
``` pre
<!-- Use all available servers as secondaries. One is primary, the rest are secondaries -->
<pool name="redX" subscription-enabled="true" subscription-redundancy="-1">
<locator host="nick" port="41111"/>
<locator host="nora" port="41111"/>
</pool>
```
When redundancy is enabled, secondary servers maintain queue backups while the primary server pushes events to the client. If the primary server fails, one of the secondary servers steps in as primary to provide uninterrupted event messaging to the client.
The following table describes the different values for the subscription-redundancy setting:
| subscription-redundancy | Description |
|-------------------------|--------------------------------------------------------------------------------|
| 0 | No secondary servers are configured, so high availability is disabled. |
| &gt; 0 | Sets the precise number of secondary servers to use for backup to the primary. |
| -1 | Every server that is not the primary is to be used as a secondary. |