- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How to add hdfs property using cm rest api
- Labels:
-
Apache Hadoop
-
Cloudera Manager
-
HDFS
Created on ‎06-01-2016 12:45 AM - edited ‎09-16-2022 03:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We need to add proxyuser properties to hdfs-site.xml during installation of our product.
CM REST API allows only update of existing property.
Does anyone know how to add property without GUI?
I tried the gollowing statement, but it fails:
curl -iv -X PUT -H "Content-Type:application/json" -H "Accept:application/json" -d '{"items":[{ "name": "ztsps_hadoop_proxyuser_groups_list","value": "*", "required": false, "default": "*", "displayName": "PS Proxy User Hosts", "description" : "PS user groups", "relatedName": "hadoop.proxyuser.ztsps.groups", "validationState" : "OK", "validationWarningsSuppressed" : false}]}' http://admin:admin@10.1.0.1:7180/api/v12/clusters/cluster/services/hdfs/config
It returns:
{
"message" : "Unknown configuration attribute 'ztsps_hadoop_proxyuser_groups_list'."
* Connection #0 to host 10.1.0.1 left intact
* Closing connection #0
}
Any help will be greatly appreciated,
Igor Kiselev.
Created ‎06-06-2016 08:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I do find that if I query the GATEWAY role directly it shows up the MR2 configs. Given that MR2 is a purely GATEWAY + JOBHISTORYSERVER aspect in YARN, this would make sense, but I agree the service-level exhaustive config ought to show it too, and I'll report this internally to see what's up and if it can be changed to show the values in the future.
Something such as the below would work in the meantime:
curl -k -iv -X GET 'http://admin:admin@HOST:7180/api/v12/clusters/cluster/services/yarn/roles/YARN-GATEWAY-1/config?view=full'
You can grab your gateway rolename from the services/yarn/roles endpoint first, in case its something custom. In my example above the rolename was "YARN-GATEWAY-1".
Created ‎06-02-2016 12:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[1] - http://www.cloudera.com/documentation/enterprise/latest/topics/cm_props_cdh570_hdfs.html
Created ‎06-02-2016 12:56 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Harsh,
thank you very much for your response. I looked at the doc and it instructs how to add property through GUI.
We are looking for command line capability. Does it exist? Anything, REST API or some script(Ambari has one)?
Please, let me know even if the only way is GUI. I would need to rethink our approach, if Cloudera does not provide command line capability to add properties.
I will really appreciate your answer, since it will spare me from fruitless research attemts and will save me time.
Regards,
Igor Kiselev.
Created ‎06-02-2016 05:08 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You require to do something like this (notice the name of the config being the safety valve described earlier, and that the value is in XML form with the contents of what you are trying to add in):
curl -iv -X PUT -H "Content-Type:application/json" -H "Accept:application/json" -d '{"items":[{ "name": "core_site_safety_valve","value": "<property><name>hadoop.proxyuser.ztsps.users</name><value>*</value></property><property><name>hadoop.proxyuser.ztsps.groups</name><value>*</value></property>"}]}' http://admin:admin@10.1.0.1:7180/api/v12/clusters/cluster/services/hdfs/config
Created ‎06-03-2016 12:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Harsh,
thank you very much. I was glad to find out after reading your response that solution that I came to right one while waiting for the response.
May I ask you another question. I also need to modify value of mapreduce.application.classpath property. It is in mapred-site.xml. I cannot find API ways to do this. I cannot even retrieve any mapred properties with API. There is no mapred service. Only yarn. Could you, please, help.
Or should I open another topic?
Regards,
Igor Kiselev.
Created ‎06-03-2016 01:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are looking for the config in CM named "mapreduce_application_classpath" with default value '$HADOOP_MAPRED_HOME/*, $HADOOP_MAPRED_HOME/lib/*, $MR2_CLASSPATH'?
Created ‎06-03-2016 11:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Harsh,
thank you again and yes, I am looking for mapreduce_application_classpath. I need to append the value. Unfortunately curl -X GET -i http://admin:admin@10.1.0.1:7180/api/v12/clusters/cluster/services/yarn/config?view=full does not return this property at all. And there is no mapred service.
How I can get and modify this value through API?
As usual, your answer will be greatly appreaciated. This looks like my last problem.
Regards,
Igor Kiselev.
Created ‎06-06-2016 08:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I do find that if I query the GATEWAY role directly it shows up the MR2 configs. Given that MR2 is a purely GATEWAY + JOBHISTORYSERVER aspect in YARN, this would make sense, but I agree the service-level exhaustive config ought to show it too, and I'll report this internally to see what's up and if it can be changed to show the values in the future.
Something such as the below would work in the meantime:
curl -k -iv -X GET 'http://admin:admin@HOST:7180/api/v12/clusters/cluster/services/yarn/roles/YARN-GATEWAY-1/config?view=full'
You can grab your gateway rolename from the services/yarn/roles endpoint first, in case its something custom. In my example above the rolename was "YARN-GATEWAY-1".
Created ‎06-09-2016 11:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Harsh,
thank you very much for all your help. I found how how to create and use roles through API.
Everything works.
Regards,
Igor Kiselev.
Created ‎06-10-2016 12:38 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
