Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

configure hbase replication using python api (cm_api)

Solved Go to solution

configure hbase replication using python api (cm_api)

Hi

 

I want to write a script using python api (cm_api) to configure hbase replication.

 

I looked over documentation but did not find anything helpful

 

Is it possible ?

 

Thanks

Gregory

1 ACCEPTED SOLUTION

Accepted Solutions

Re: configure hbase replication using python api (cm_api)

Master Guru

One part of HBase Replication is that of turning on configs on the Server end to enable the feature. This can be done via the API exactly like Marcell described.

The other part of replication configs is the peer configuration, but this is not doable via CM API as it is not a service-passed configuration, but more of a runtime one. You will need to use HBase's Java API (ReplicationAdmin class) directly for this: http://archive.cloudera.com/cdh5/cdh/5/hbase/apidocs/org/apache/hadoop/hbase/client/replication/Repl.... To do this in Python, I'd guess you will need to use Jython or such.

2 REPLIES 2

Re: configure hbase replication using python api (cm_api)

Cloudera Employee

Hi Gregory,

Do you want to achieve what is documented here?

http://www.cloudera.com/documentation/cdh/5-1-x/CDH5-Installation-Guide/cdh5ig_hbase_replication.htm...

 

Out of these steps 1,2,3 are the ones that Cloudera Manager is involved in.

You need to update the config

 https://cloudera.github.io/cm_api/apidocs/v11/path__clusters_-clusterName-_services_-serviceName-_co...

And restart

 https://cloudera.github.io/cm_api/apidocs/v11/path__clusters_-clusterName-_services_-serviceName-_co...

 

Other steps run in the shell.

 

Regards,

Marcell

Re: configure hbase replication using python api (cm_api)

Master Guru

One part of HBase Replication is that of turning on configs on the Server end to enable the feature. This can be done via the API exactly like Marcell described.

The other part of replication configs is the peer configuration, but this is not doable via CM API as it is not a service-passed configuration, but more of a runtime one. You will need to use HBase's Java API (ReplicationAdmin class) directly for this: http://archive.cloudera.com/cdh5/cdh/5/hbase/apidocs/org/apache/hadoop/hbase/client/replication/Repl.... To do this in Python, I'd guess you will need to use Jython or such.