【问题标题】:How to use Ambari API to Update Configs with a file如何使用 Ambari API 通过文件更新配置
【发布时间】:2020-04-07 21:19:12
【问题描述】:

所以你不能直接更新单个项目,而必须获取与之关联的整个配置组。

我所做的是:

# read the tag of target config i want
curl -u $USERNAME:$PASSWORD -H "X-Requested-By: ambari" -X GET $BASE_URI?fields=Clusters/desired_configs > .temp_json

# download my configs
curl -u $USERNAME:$PASSWORD -H "X-Requested-By: ambari" -X GET "$BASE_URI/configurations?type=$CONFIG_TYPE&tag=$TARGET_TAG" > .configs_to_update

# update configs here > UPDATED_FILE_HERE

# ??? (upload the configs)

下一步是将配置上传到服务器,然后重新启动服务。我似乎无法弄清楚上传配置的 API 调用。有谁知道我如何使用 Ambari REST API 上传配置?

【问题讨论】:

    标签: hadoop ambari


    【解决方案1】:

    我不确定这是否对您的情况有所帮助,但请查看我用来调整单个配置的命令:

    python /var/lib/ambari-server/resources/scripts/configs.py -u admin -p admin -n HDP3 -l c7404.ambari.apache.org -t 8080 -a set -c cluster-env -k  ignore_groupsusers_create -v true
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-08-05
      • 1970-01-01
      • 2015-04-11
      • 2018-08-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多