Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Unable to add Datanode Data directory at Datanode Default Group

Unable to add Datanode Data directory at Datanode Default Group

New Contributor

Hello,

I am trying to add role, i am unable to add data directory to datanode Default Group it s adding new list over there,

 

Below is the snippet i am using,


api_instance = cm_client.ServicesResourceApi(cm_client.ApiClient(api_client))

service_name = 'HDFS' # str |
body = cm_client.ApiRoleList([cm_client.ApiRole(name="DATANODE", type="DATANODE",
host_ref=cm_client.ApiHostRef(
host_id=host_response.items[1].host_id),
service_ref=cm_client.ApiServiceRef(cluster_name=cluster_name,
service_name=service_name),
config=cm_client.ApiConfigList([cm_client.ApiConfig(
name="dfs_data_dir_list", value="/data/dfs/dn")]),
),
cm_client.ApiRole(name="NAMENODE", type="NAMENODE",
host_ref=cm_client.ApiHostRef(
host_id=host_response.items[0].host_id),
service_ref=cm_client.ApiServiceRef(cluster_name=cluster_name,
service_name=service_name),
config=cm_client.ApiConfigList([cm_client.ApiConfig(
name="dfs_name_dir_list", value="/data/dfs/nn")]),
),
cm_client.ApiRole(name="SECONDARYNAMENODE", type="SECONDARYNAMENODE",
host_ref=cm_client.ApiHostRef(
host_id=host_response.items[0].host_id),
service_ref=cm_client.ApiServiceRef(cluster_name=cluster_name,
service_name=service_name),
config=cm_client.ApiConfigList([cm_client.ApiConfig(
name="fs_checkpoint_dir_list", value="/dfs/snn")])
),
])

try:
# Create new roles in a given service.
api_response = api_instance.create_roles(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->create_roles: %s\n" % e)

what would be the correct configuration.

Any help would be appreciated.

 

Thanks