Setting the secure storage password as an environment variable

If any of the clusters that Streams Replication Manager (SRM) connects to are secured, and you have set up and configured the SRM client’s secure storage, you must set the secure storage password as an environment variable in your CLI session before running the srm-control tool.

The SRM Client’s secure storage is password protected. In order for the srm-control tool to access the secure storage, it must know the password protecting the secure storage. This password is specified by the user in Cloudera Manager, however it cannot be automatically passed to the tool. This is because the tool is not an entity that is managed by Cloudera Manager. As a result, if any of the Kafka clusters in your replication scenario are secured, and you have set up and configured the SRM client’s secure storage, you must configure this password for the srm-control tool. This is done by setting the secure storage password as an environment variable in your CLI session before you run the tool.

  • Ensure that you have reviewed the information available in Configuring srm-control and understand that the following step list is only one part of the full configuration workflow. Depending on your scenario, completing other configuration tasks might be required.

  • Ensure that setup and configuration of the SRM service is complete:
    • The Kafka clusters that SRM connects to are defined and are added to the SRM service’s configuration. This includes both external and co-located clusters.

    • Replications are configured.

  1. SSH into one of the SRM hosts in your cluster.
  2. Set the secure storage password as an environment variable.
    export [***SECURE STORAGE ENV VAR***]=”[***SECURE STORAGE PASSWORD***]
    Replace [***SECURE STORAGE ENV VAR***] with the name of the environment variable you specified in Environment Variable Holding SRM Client's Secure Storage Password. Replace [***SRM SECURE STORAGE PASSWORD***] with the password you specified in SRM Client's Secure Storage Password. For example:
    export SECURESTOREPASS=”mypassword
Run the srm-control tool. How you run the tool depends on how it was configured:
  • If you did not create a copy of the default configuration file you can run the tool without the --config option.
    For example:
    srm-control topics --source [***SOURCE_CLUSTER***] --target [***TARGET_CLUSTER***] --add [***TOPIC1***],[***TOPIC2***]
  • If a custom configuration file was created, you must run the tool using the --config option.
    For example:
    srm-control topics --config [***PATH TO CUSTOM CONFIGURATION FILE***] --source [***SOURCE_CLUSTER***] --target [***TARGET_CLUSTER***] --add [***TOPIC1***],[***TOPIC2***]

For more information and command examples, see the documentation on the topics, groups, and offsets subcommands.