Configuration Overview
Learn how to configure SRM with the srm.properties
configuration file.
SRM configuration is managed through a single configuration file. The default location of the
configuration file for .rpm based installs is
/opt/streams-replication-manager/config
. For ZIP or TAR based installations
the default location is $SRM_CONF_DIR/srm.properties
. The default name of the
file is srm.properties
.
Command line tools provided with SRM read configuration properties from the configuration
file. All tools automatically collect configuration information from the default file. If
required it is possible to store the configuration file at a different location. In this case
however, you need to specify the configuration file and its location when using the tools.
Specifying an alternate location for the file is achieved with the --config
option which is supported by all SRM command line tools.
The srm.properties
file accepts all Kafka client properties available in the
version of Kafka that you are using. Additionally, it supports a number of SRM specific
configuration properties. For a comprehensive list of SRM specific properties, see
Configuration Properties Reference.
- Top level: Top level or global configuration is achieved by adding the property
on its own. For example:
replication.factor=3
- Cluster level: Cluster level configuration can be achieved by prepeding the
configuration property with a cluster alias. For
example:
primary.replication.factor=3
- Replication level: Replication level configuration can be achieved by prepeding
the configuration property with the name of the replication. For
example:
primary->secondary.replication.factor=3
Minimum Configuration
At minimum the configuration file has to contain cluster aliases, cluster connection
information, and at least one cluster->cluster
replication that is enabled.
clusters
property. Aliases are
arbitrary names defined by the user. They are used in other configuration properties as well
as with the SRM command line tools to refer to the clusters added for replication. For
example: #Kafka cluster aliases clusters = primary, backup
bootstrap.servers
property. You add
connection information by prepending the bootstrap.servers
property with a
cluster alias and adding the address of the Kafka broker as the value. When configuring
connection information, add each cluster to a new line. If a cluster has multiple hosts, add
them to the same line but delimit them with commas. For
example:#Kafka broker addresses primary.bootstrap.servers = primary-cluster1.vpc.example.com:9092, primary-cluster2.vpc.example.com:9092, ... backup.bootstrap.servers = backup-cluster1.vpc.example.com:9092, backup-cluster1.vpc.example.com:9092, ...
Cluster replications can be set up and enabled as follows:
primary->backup.enabled = true backup->primary.enabled = true
The default srm.properties
shipped with SRM contains examples for cluster
aliases, connection information, and cluster->cluster
replications. In
addition, it also contains a number of other pre-set properties. These properties however
are not required for SRM to function, they are included to give users a basic example of how
the configuration file can be set up. Cloudera recommends that you study the example
configuration provided in Configuration Examples to find out more about how SRM
should be set up for different replication scenarios.