You can configure replication by editing the
etc/Replication.xml files of your Diffusion™ servers.
Ensure that you use the same replication configuration on all of the Diffusion servers in your cluster.
Ensure that each server in the cluster has a unique name, as set in etc/Server.xml or the host name
if not set.
Configuration items (topic views, metric collectors,
and the security/system authentication stores) are replicated if any form of replication is enabled.
-
Edit the Replication.xml file to configure
replication.
<replication>
<provider>HAZELCAST</provider>
<customConfigurator/>
<connector>High Volume Connector<connector>
<sessionReplication enabled="true" />
<topicReplication enabled="true">
<topics>
<excludes>Diffusion</excludes>
</topics>
</topicReplication>
</replication>
- In the sessionReplication element, set
enabled to true to configure the
server to replicate sessions between servers in the cluster.
- In the topicReplication element, set
enabled to true to configure the
server to replicate topics between servers in the cluster.
- If either session or topic replication is enabled, configuration items are replicated. To enable
configuration replication without session/topic replication, add a configurationReplication
element and set its enabled property to true.
Inside the topics element, use either
includes or excludes elements to
define the topics for topic replication and failover of the active update source.
You can use one or more includes elements, or one or more excludes
elements. You cannot mix includes and excludes.
Each element should contain a path identifying a branch of the topic tree.
If you use includes elements, topic replication and failover are applied to the specified branches.
If you use excludes elements, topic replication and failover are applied to all topics except those
belonging to the specified branches.
Unlike a topic selector, the topic path does not contain any leading or
trailing characters. For example, use
<includes>foo/bar</includes> to
select all topics in the branch foo/bar.
-
In the etc/Connectors.xml file, check there is a connector element with the same name as the
connector specified in Replication.xml.
By default, Connectors.xml contains a "High Volume Connector" profile which you can
use for replication. You should tune the profile based on your particular requirements.
-
Consider adding a quorum element inside the replication element.
This defines a minimum number of servers in a cluster, below which all servers will shut down.
Using this setting can
prevent issues after a network partition separates a cluster, and the two resulting clusters try to rejoin,
leading to inconsistent data (a "split-brain" condition). See
Server clusters for high availability for details.
-
Restart the Diffusion server to load the
configuration.
-
Ensure that your clients are configured to reconnect if they lose their
connection to the server.