Support Questions

Find answers, ask questions, and share your expertise

rest api to fetch config files like hdfs-site.xml, yarn-site.xml etc

avatar

I want to fetch all hadoop config files with all configuration ? for e.g hdfs, hive, hbase , yarn etc conif files

1 ACCEPTED SOLUTION

avatar
Master Mentor

@Anurag Mishra

You can try the following API call. I tested it on Ambari 2.5.1 which provides this option to download configs.

# mkdir /tmp/All_Configs
# cd /tmp/All_Configs/

# curl -iv -u admin:admin -H "X-Requested-By: ambari" -X GET  http://localhost:8080/api/v1/clusters/Sandbox/components?format=client_config_tar   -o /tmp/All_Configs/cluster_configs.tar.gz

.

Now you can extract the "/tmp/All_Configs/cluster_configs.tar.gz" file and then you can find most of the configs.

I found the following configs inside the mentioned gz file:

Downloads/Sandbox\(CLUSTER\)-configs 

| | | |____Sandbox(CLUSTER)-configs
| | | | |____.DS_Store
| | | | |____ATLAS_CLIENT
| | | | | |____application.properties
| | | | | |____atlas-env.sh
| | | | | |____atlas-log4j.xml
| | | | | |____atlas-solrconfig.xml
| | | | |____FALCON_CLIENT
| | | | | |____falcon-env.sh
| | | | | |____runtime.properties
| | | | | |____startup.properties
| | | | |____HBASE_CLIENT
| | | | | |____hbase-env.sh
| | | | | |____hbase-policy.xml
| | | | | |____hbase-site.xml
| | | | | |____log4j.properties
| | | | |____HDFS_CLIENT
| | | | | |____core-site.xml
| | | | | |____hadoop-env.sh
| | | | | |____hdfs-site.xml
| | | | | |____log4j.properties
| | | | |____HIVE_CLIENT
| | | | | |____hive-env.sh
| | | | | |____hive-exec-log4j.properties
| | | | | |____hive-log4j.properties
| | | | | |____hive-site.xml
| | | | |____INFRA_SOLR_CLIENT
| | | | | |____log4j.properties
| | | | |____MAPREDUCE2_CLIENT
| | | | | |____core-site.xml
| | | | | |____mapred-env.sh
| | | | | |____mapred-site.xml
| | | | |____OOZIE_CLIENT
| | | | | |____oozie-env.sh
| | | | | |____oozie-log4j.properties
| | | | | |____oozie-site.xml
| | | | |____PIG
| | | | | |____log4j.properties
| | | | | |____pig-env.sh
| | | | | |____pig.properties
| | | | |____SLIDER
| | | | | |____core-site.xml
| | | | | |____hdfs-site.xml
| | | | | |____log4j.properties
| | | | | |____slider-client.xml
| | | | | |____slider-env.sh
| | | | | |____yarn-site.xml
| | | | |____SPARK2_CLIENT
| | | | | |____spark-defaults.conf
| | | | | |____spark-env.sh
| | | | | |____spark-log4j.properties
| | | | | |____spark-metrics.properties
| | | | |____SPARK_CLIENT
| | | | | |____spark-defaults.conf
| | | | | |____spark-env.sh
| | | | | |____spark-log4j.properties
| | | | | |____spark-metrics.properties
| | | | |____SQOOP
| | | | | |____sqoop-env.sh
| | | | | |____sqoop-site.xml
| | | | |____TEZ_CLIENT
| | | | | |____tez-env.sh
| | | | | |____tez-site.xml
| | | | |____YARN_CLIENT
| | | | | |____capacity-scheduler.xml
| | | | | |____core-site.xml
| | | | | |____log4j.properties
| | | | | |____yarn-env.sh
| | | | | |____yarn-site.xml
| | | | |____ZOOKEEPER_CLIENT
| | | | | |____log4j.properties
| | | | | |____zookeeper-env.sh

.

View solution in original post

13 REPLIES 13

avatar

@Jay SenSharma

still it is same

new_cluster_configs.tar.gz: ASCII text

Note: i am using ambari admin credentials and in place of localhost id address ambari is installed

can you pls elaborate more about format=client_config_tar

avatar
@Jay SenSharma

my ambari version is 2.4 probably that could be reason

avatar
Master Mentor

@Anurag Mishra

Yes, the "Download All Client Configs" feature is introduced from Ambari 2.5 onwards.

In Ambari 2.4 and previous version you will need to go to individual service and then from the "Service Actions" dropdown you will need to choose "Download Client Configs".

Like Ambari UI --> HDFS -->Service Actions --> "Download Client Configs".

avatar

@Jay SenSharma

I am able to download client config files but one problem I am facing is that only those client configs are downloadable which are present in that localhost, but I wanted to download all client configs present in whole cluster, which rest api should I use to achieve same ?