2

I am trying to automate some of the Hadoop cluster deployment work through cloudera manager api (cm_api). So far I am able to add new host to cloudera manager, add to cluster & apply template to it using this https://github.com/cloudera/cm_api/tree/master/python/src/cm_api/endpoints

Now I am looking a way to update role configuration like (yarn.nodemanager.local-dirs, yarn.nodemanager.resource.memory-mb, yarn.nodemanager.resource.cpu-vcores) for each instance in YARN service depending on how much disk, cpu & memory each instance got.

Anyone know how do I do this using cm_api in python ?

Thanks

roy
  • 6,344
  • 24
  • 92
  • 174

1 Answers1

0
service = cluster.get_service("YARN-" + p.get('cluster')['name'])
for role in service.get_all_role_config_groups():
    if 'NODEMANAGER' in role.roleType:
        role.update_config({"yarn_nodemanager_local_dirs": '/dfs/nm-local-dir'})
Shane
  • 1
  • 2