Andrea T. Bonanno
Andrea T. Bonanno

Reputation: 221

How can I make hdfs-site.xml and core-site.xml accessible via browser with Ambari?

I need files hdfs-site.xml and core-site.xml to be accessible via url since a service I am installing need to retrieve those files at setup. I am using Ambari to manage my hdfs and my hadoop/stack.

Upvotes: 0

Views: 615

Answers (1)

melhior
melhior

Reputation: 139

Looks like Ambari itself have no ability to do this directly. One way to download configs is using "Download Client Configs" menu option under Service Actions, it will give you configs, but in a tar.gz archive which has to be untared. Example of API call for it is:

http://c6401:8080/api/v1/clusters/cl1/services/HDFS/components/HDFS_CLIENT?format=client_config_tar

Ambari API also allows getting configs all configs of the cluster as JSON: https://cwiki.apache.org/confluence/display/AMBARI/Modify+configurations#Modifyconfigurations-EditconfigurationusingAPIs(2.4.0+)

As a last resort, you can start HTTP server in /etc/hadoop/conf directory of your ambari-server machine. It can be simply done by issuing:

# cd /etc/hadoop/ ; python -m SimpleHTTPServer 50071

And your hdfs-site.xml will be at http://c6401:50071/conf/hdfs-site.xml

Note that you have to choose port for server that is not busy.

Upvotes: 1

Related Questions