Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

API + how to verify data node disk by API

avatar

on ambari GUI by clicking on HDFS --> config --> (we can see the data node folders that actually represented the worker disks)

how to use API in order to capture the number of disks from the blueprint ?

Michael-Bronson
1 ACCEPTED SOLUTION

avatar
Master Mentor

@Michael Bronson

Looks like you want to fetch the details of "dfs.datanode.data.dir" property. In that case you can try using the following call. (please revert back if you are talking about a slightly different property)

Syntax:

# curl -sH "X-Requested-By: ambari" -u admin:admin -X GET "http://$AMBARI_HOSTNAME:8080/api/v1/clusters/$CLUSTER_NAME/configurations/service_config_versions?service_name=HDFS&is_current=true" | grep "\"dfs.datanode.data.dir\"" 



Example:

# curl -sH "X-Requested-By: ambari" -u admin:admin -X GET "http://amb25101.example.com:8080/api/v1/clusters/plain_ambari/configurations/service_config_versions?service_name=HDFS&is_current=true" | grep "\"dfs.datanode.data.dir\"" 


Output:

  "dfs.datanode.data.dir" : "/hadoop/hdfs/data",

.


Please replace the "$AMBARI_HOSTNMAE" and "$CLUSTER_NAME" based on your environment.

.

View solution in original post

1 REPLY 1

avatar
Master Mentor

@Michael Bronson

Looks like you want to fetch the details of "dfs.datanode.data.dir" property. In that case you can try using the following call. (please revert back if you are talking about a slightly different property)

Syntax:

# curl -sH "X-Requested-By: ambari" -u admin:admin -X GET "http://$AMBARI_HOSTNAME:8080/api/v1/clusters/$CLUSTER_NAME/configurations/service_config_versions?service_name=HDFS&is_current=true" | grep "\"dfs.datanode.data.dir\"" 



Example:

# curl -sH "X-Requested-By: ambari" -u admin:admin -X GET "http://amb25101.example.com:8080/api/v1/clusters/plain_ambari/configurations/service_config_versions?service_name=HDFS&is_current=true" | grep "\"dfs.datanode.data.dir\"" 


Output:

  "dfs.datanode.data.dir" : "/hadoop/hdfs/data",

.


Please replace the "$AMBARI_HOSTNMAE" and "$CLUSTER_NAME" based on your environment.

.