Created on 04-26-2020 07:48 AM - edited 04-26-2020 07:51 AM
hi all
is it possible to stop only the data node services on all datanodes machines?
in the following example , we can see example of datanode service from worker machine
and the 3/3 datanodes services
example of the full services on each worker machine:
Created 04-26-2020 06:15 PM
@mike_bronson7
You can try this.
1. Get the list of DataNode hosts. When you can get like following:
# curl -s -u admin:admin -H "X-Requested-By: ambari" -X GET http://$AMBARI_FQDN:8080/api/v1/clusters/CLUSTER_NAME/services/HDFS/components/DATANODE | grep 'host_name'
2. The. run the following kind of API call by passing the hostnames where the datanode are running. Suppose datanodes are running on 3 Hosts with name "dn1.example.com, dn2.example.com, dn3.example.com" then you can do the following:
# curl -s -u admin:admin -H "X-Requested-By: ambari" -X PUT -d '{"RequestInfo":{"context":"Stop DataNodes","operation_level":{"level":"SERVICE","cluster_name":"$CLUSTER_NAME"},"query":"HostRoles/component_name=DATANODE&HostRoles/host_name.in(dn1.example.com,dn2.example.com,dn3.example.com)&HostRoles/maintenance_state=OFF"},"Body":{"HostRoles":{"state":"INSTALLED"}}}' "h ttp://$AMBARI_FQDN:8080/api/v1/clusters/$CLUSTER_NAME/host_components"
.
Please replace all $CLUSTER_NAME and $AMBARI_FQDN accordingly.
Created 04-26-2020 08:49 PM
Dear Jay , give me some time I will verify the API on my cluster
is it possible to use the API from your answer , to stop all NodeManager on all workers machines?
Created on 04-27-2020 01:27 AM - edited 04-27-2020 01:28 AM
Dear Jay
lets say we want to set instead
dn1.example.com,dn2.example.com,dn3.example.com
we want to set variable
all_DN_machines=dn1.example.com,dn2.example.com,dn3.example.com
so the val - $all_DN_machines will be instead of all real machines - is it possible ?
Created 04-27-2020 03:50 AM
Created 04-27-2020 04:07 AM
Dear Jay - can we use this API to stop all NodeManager on all workers machines ? if yes , can you show me please how ?