Skip to main content
naymar
Silver ⭐️⭐️
March 4, 2024
Question

Managing Replication Using API

I'm looking to administer HDFS and Hive replication via API. The replication jobs have been set up. My question is, can these replication jobs be viewed in the Cloudera Manager UI under Replication Policies?

4 replies

FelipeG
Silver ⭐️⭐️⭐️
Silver ⭐️⭐️⭐️
March 4, 2024

Hello,

May you provide the CDP/CM version and what API are you using as example ?

* Since the jobs execution and jobs are maintained in the DB I would say they should appear in the CM UI, yes.

Translate
naymar
naymarAuthor
Silver ⭐️⭐️
March 5, 2024

I am using CM 7.11.3 with CDP 7.1.9 and Cloudera Manager Rest API.

Translate
soychago
Gold ⭐️
Gold ⭐️
March 5, 2024

@naymar after setting up the replication jobs, they should be visible in the CM UI.

In CM version 6.x and 5.15.x, under Backup > Replication Schedules and for CM 7, under  Replication > Replication Policies.

They're also stored in the backend DB. You can check them with:

SELECT COMMAND_NAME,SERVICE_ID,START_TIME,DISPLAY_NAME,DESCRIPTION FROM COMMAND_SCHEDULES;

If you want to check the arguments you set:

SELECT COMMAND_NAME,SERVICE_ID,COMMAND_ARGUMENTS,START_TIME,DISPLAY_NAME,DESCRIPTION FROM COMMAND_SCHEDULES;

 If you want to check only the HDFS replication schedules:

SELECT COMMAND_NAME,SERVICE_ID,COMMAND_ARGUMENTS,START_TIME,DISPLAY_NAME,DESCRIPTION FROM COMMAND_SCHEDULES WHERE COMMAND_NAME='HdfsReplicationCommand';

 

On the below TSB article, you can refer yourself to some of the API used to fetch the replications from the CM UI (:warning:NOTE: the TSB will prompt you to enter your Cloudera credentials)

https://my.cloudera.com/knowledge/TSB-2024-734-The-Replication-Policies-page-of-Replication?id=382627 

For instance, using the URL example, the following curl command should return the history of policies:

 

curl -X GET “http://hostname:7180/api/v49/clusters/Cluster%201/services/HIVE-1/replications?view=summary" -H "accept: application/json"

 

Also, the below API should give a you a list of all the replications setup in the CM

http[s]://hostname[:port]/api/v49/clusters/<clusterName>/services/<serviceName>/replications

Translate
DianaTorres
Community Manager
Community Manager
March 8, 2024

@naymar Has the reply helped resolve your issue? If so, please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future.  Thanks.

Translate
Regards, Diana Torres, Senior Community Moderator