Creating HBase replication policy using CDP CLI
You can use CDP CLI commands to create an HBase replication policy.
-
Log into Replication Manager CDP CLI setup:
cdp --profile [***PROFILE NAME***] replicationmanager
-
List the clusters to verify whether the required clusters are available:
cdp --profile [***PROFILE NAME***] replicationmanager list-clusters
-
Verify whether the required services are running on the required
clusters:
cdp --profile [***PROFILE NAME***] replicationmanager list-cluster-service-statuses
-
Ensure that the cloud credentials are available:
cdp --profile [***PROFILE NAME***] replicationmanager list-all-credentials
-
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
orRESETTABLE
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. -
Create a policy definition JSON file.
-
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
- Enter the required parameters. Remove the key-value pairs that are not required in the policy definition JSON file for the specific policy.
- Save the file.
-
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:
-
Create the HBase replication policy:
cdp --profile [***PROFILE NAME***] replicationmanager create-hbase-policy --cli-input-json [***POLICY DEFINITION JSON***]
Optionally, you can use thecat
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)”
cdp --profile [***PROFILE NAME***] replicationmanager list-policies --cluster-crn [***CRN OF THE CLUSTER WHERE THE REPLICATION POLICIES ARE STORED***]