Mastering Hadoop 3
上QQ阅读APP看书,第一时间看更新

Administration commands

Hadoop admin is responsible for managing the YARN cluster and configuring the scheduler, queue, and other properties. YARN provides a command-line interface to admin to manage the cluster. The following are a few important commands that are used frequently:

  • nodemanager: The nodemanager is available on every worker node in the YARN cluster. The following command is used to start the nodemanager service:
        YARN nodemanager

  • rmadmin: The Resource Manager is a master node in the YARN cluster and the rmadmin command is used to manage services at the Resource Manager level. The following is the syntax for rmadmin:
        YARN -rmadmin option 

The options that can be used with the rmadmin command are as follows:

  • -refreshQueues: Sometimes, queue configurations such as ACLs, and queue info, may require changing. Once the changes are made, admin needs to refresh the queue so that the Resource Manager will reload the configuration file and the queue configuration, such as ACLs, state, and scheduler properties, as follows:
        YARN rmadmin -refreshQueues
  • -refreshNodesDecommissioning and commissioning a node are the basic commands in any YARN cluster. These commands will refresh the host information of the node at the Resource Manager, as follows:
        YARN rmadmin -refreshNodes 
  • -refreshNodesResources: The Node Manager contains the resource information about the node they manage. At regular intervals, the information is sent to the Resource Manager. The admin can manually refresh the node information, as follows:
        YARN rmadmin refreshNodesResources
  • -refreshAdminAcls: The cluster can have more than one admin and each one of them can have different ACLs. The ACL for admins can be changed or new ACLs can be added for admins. The refreshAdminAcls will reload the ACLs to the Resource Manager.
  • -refreshServiceAcl: The services that YARN manages may not be accessible to all users. This command will trigger the Resource Manager to reload the service ACL policy. 
  • -getGroups username: This returns the group name to which the user belongs. 
  • service commands: There are a list of service commands that admin can execute to get the state of the service, check service health, or change the state of the service from active to standby, and the other way around, which are as follows:
        YARN rmadmin -transitionToActive serviceId
YARN rmadmin -transitionToActive serviceId
YARN rmadmin -getServiceState serviceId
YARN rmadmin -checkHealth serviceId
  • schedulerconf: The scheduler configuration of a YARN cluster can be changed by this command. The queue can be modified, added, and removed using the schedulerconf command, as follows:
        YARN schedulerconf -add   
<"queuePath1:key1=val1,key2=val2;queuePath2:key3=val3">
  • Removing queue: The queues can be removed using the following command:
         YARN schedulerconf -remove 
<"queuePath1;queuePath2;queuepath3">