Creating HBase replication policy using CDP CLI

You can use CDP CLI commands to create an HBase replication policy.

Ensure that the prerequisites are complete before you create an HBase replication policy. For more information about the prerequisites, see Using HBase replication policies.
  1. Log into Replication Manager CDP CLI setup:
    cdp --profile [***PROFILE NAME***] replicationmanager
  2. List the clusters to verify whether the required clusters are available:
    cdp --profile [***PROFILE NAME***] replicationmanager list-clusters
  3. Verify whether the required services are running on the required clusters:
    cdp --profile [***PROFILE NAME***] replicationmanager list-cluster-service-statuses
  4. Ensure that the cloud credentials are available:
    cdp --profile [***PROFILE NAME***] replicationmanager list-all-credentials
  5. Verify whether the source cluster and target cluster are paired:
    cdp --profile [***PROFILE NAME***] replicationmanager verify-hbase-cluster-pair
    The command returns the following cluster pairing status:
    pairingStatus Description
    PAIRED Indicates that the clusters are paired and Replication Manager attempts to initiate the first-time setup between the clusters. The following status appear during the pairing process:
    • ERROR - Indicates that the policy creation process cannot be continued unless the error is fixed and the pairing is reset.
    • UNDER_SETUP - Indicates that you must wait for the process to complete before you continue to create the replication policy.
    • RESETTABLE - Indicates that the pairing process completed successfully and that there are no existing replication policies using this pairing.

      You can continue to create the HBase replication policy.

    • NOT_RESETTABLE - Indicates that the pairing process completed successfully and there are existing policies using this pairing.

      You can continue to create the HBase replication policy.

    CAN_BE_FORCED Indicates that one or both of the specified clusters are part of other pairings that are in ERROR or RESETTABLE state.

    You can set up the pairing between the clusters by setting the force* parameter to true. This action removes the existing pairings.

    WRONG_PAIRING Indicates that one or both of the specified clusters are part of other pairings that are in NOT_RESETTABLE state.

    In this scenario, you cannot continue to create HBase replication policies.

    ON_HOLD Indicates that one or both of the specified clusters are part of other pairings that are in UNDER_SETUP state.

    In this scenario, you can retry the pairing process after some time.

    *The option is a technical preview feature and is not ready for production deployment. The components are provided ‘as is’ without warranty or support. Further, Cloudera assumes no liability for the use of preview components, which should be used by customers at their own risk. For more information, contact your Cloudera account team.
  6. Create a policy definition JSON file.
    1. Open a policy definition JSON file, or copy the output of the following command to a JSON file to generate a policy definition JSON file:
      cdp --profile [***PROFILE NAME***] replicationmanager create-hbase-policy --generate-cli-skeleton
      cdp --profile hbase1 replicationmanager create-hbase-policy --generate-cli-skeleton > rm_hbase1.json
    2. Enter the required parameters. Remove the key-value pairs that are not required in the policy definition JSON file for the specific policy.
    3. Save the file.
  7. Create the HBase replication policy:
    cdp --profile [***PROFILE NAME***] replicationmanager create-hbase-policy --cli-input-json [***POLICY DEFINITION JSON***] 
    Optionally, you can use the cat command to read the data from the policy definition JSON file. For example, cdp --profile local-dev replicationmanager create-policy --cli-input-json “$(cat temp/rm_hbase1.json)”
Replication Manager creates the replication policy and initiates data replication.
Verify whether the replication policy is running as expected on the Cloudera Replication Manager > Replication Policies page, or run the following command:
cdp --profile [***PROFILE NAME***] replicationmanager list-policies --cluster-crn [***CRN OF THE CLUSTER WHERE THE REPLICATION POLICIES ARE STORED***]