Creating HDFS replication policy using CDP CLI

You can use CDP CLI to create an HDFS replication policy. Only a non-machine user can run the "replicationmanager create-policy" CDP CLI command to create a replication policy.

  1. Log into Replication Manager CDP CLI setup using the cdp --profile [***profile-name***] replicationmanager command.
  2. List the clusters to verify whether the required clusters are available using the cdp --profile [***profile-name***] replicationmanager list-clusters command.
  3. Verify whether the required services are running on the source cluster using the cdp --profile [***profile-name***] replicationmanager list-cluster-service-statuses command.
  4. Ensure that the cloud credentials are available using the cdp --profile [***profile-name***] replicationmanager list-all-credentials command.
  5. Create a policy definition JSON file.
    To accomplish this task, perform the following steps:
    1. Open a policy definition JSON file, or copy the output of the cdp --profile [***profile_name***] replicationmanager create-policy --generate-cli-skeleton command to a JSON file to generate a policy definition JSON file.
      For example, cdp --profile hdfs1 replicationmanager create-policy --generate-cli-skeleton > rm_hdfs1.json
    2. Enter the required parameters.
    3. Save the file.
  6. Run the cdp --profile [***profile_name***] replicationmanager create-policy --cli-input-json [****policy definition json file path using cat***] command to create the HDFS replication policy.

    For example: cdp --profile local-dev replicationmanager create-policy --cli-input-json “$(cat temp/rm_hdfs1.json)”

Use one of the following methods to verify whether the replication policy is running as expected:
  • Run the cdp --profile [***profile_name***] replicationmanager list-policies --cluster-crn [***CRN of the cluster where the replication policies are stored***] command.
  • View the policy status on the Replication Policies page in Replication Manager.