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.

Cluster-wide Configuration Safety Valve for core-site.xml using python script and Cloudera API

Solved Go to solution

Cluster-wide Configuration Safety Valve for core-site.xml using python script and Cloudera API

New Contributor

Dear Community,

 

I wanting to ammend the Cluster-wide Configuration Safety Valve for core-site.xml using a python script and Cloudera API commands, but can't fugure out how to do it.......any assistance would be greatly appreciated !

 

I'm using Hadoop 2.0.0-cdh4.4.0

 

Graham

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Cluster-wide Configuration Safety Valve for core-site.xml using python script and Cloudera API

Hi Graham,

 

This is a service-level property of HDFS. The rest endpoint to find it looks like this:

http://<cm_host>:7180/api/v5/clusters/<cluster_name>/services/<hdfs_service_hame>/config?view=full

 

To modify it using the python api, get a handle to the HDFS service and call hdfs.update_config({"core_site_safety_valve": core_site_safety_valve_value }).

 

See more on using the python API here:

http://cloudera.github.io/cm_api/docs/python-client/

 

Thanks,

Darren

3 REPLIES 3
Highlighted

Re: Cluster-wide Configuration Safety Valve for core-site.xml using python script and Cloudera API

New Contributor

I've managed to select the attribute 'core_site_safety_valve', from the database settings for CM Manager, but doing know how to ammend this value:

 

[root@cloudera ~]# cat /etc/cloudera-scm-server/db.properties
# Auto-generated by initialize_embedded_db.sh
#
# 20131007-081546
#
# These are database settings for CM Manager
#
com.cloudera.cmf.db.type=postgresql
com.cloudera.cmf.db.host=localhost:7432
com.cloudera.cmf.db.name=scm
com.cloudera.cmf.db.user=scm
com.cloudera.cmf.db.password=AkmRKUIBSJ
[root@cloudera ~]# psql -h localhost -p 7432 -U scm
Password for user scm:
psql (8.4.13)
Type "help" for help.

scm=> select value from configs where attr = 'core_site_safety_valve';

Re: Cluster-wide Configuration Safety Valve for core-site.xml using python script and Cloudera API

Hi Graham,

 

This is a service-level property of HDFS. The rest endpoint to find it looks like this:

http://<cm_host>:7180/api/v5/clusters/<cluster_name>/services/<hdfs_service_hame>/config?view=full

 

To modify it using the python api, get a handle to the HDFS service and call hdfs.update_config({"core_site_safety_valve": core_site_safety_valve_value }).

 

See more on using the python API here:

http://cloudera.github.io/cm_api/docs/python-client/

 

Thanks,

Darren

Re: Cluster-wide Configuration Safety Valve for core-site.xml using python script and Cloudera API

New Contributor

Darren,

 

Thanks for your prompt reply, I got this working due to your information.

 

Many thanks.

 

Graham