Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

configure hbase replication using python api (cm_api)

avatar

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

avatar
Mentor

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.

View solution in original post

2 REPLIES 2

avatar
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

avatar
Mentor

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.