Changing NodeManager Storage Directories

Scenario

If the storage directories defined by the Yarn NodeManager are incorrect or the Yarn storage plan changes, the system administrator needs to modify the NodeManager storage directories on Manager to ensure that the Yarn works properly. The storage directories of NodeManager include the local storage directory yarn.nodemanager.local-dirs and log directory yarn.nodemanager.log-dirs. Changing the ZooKeeper storage directory includes the following scenarios:

Impact on the System

Prerequisites

Procedure

  1. Check the environment.

    1. Log in to Manager, choose Cluster > Name of the desired cluster > Service to check whether Running Status of Yarn is Normal.
      • If yes, go to 1.c.
      • If no, the Yarn status is unhealthy. In this case, go to 1.b.
    2. Rectify faults of Yarn. No further action is required.
    3. Determine whether to change the storage directory of the NodeManager role or that of a single NodeManager instance:
      • To change the storage directory of the NodeManager role, go to 2.
      • To change the storage directory of a single NodeManager instance, go to 3.

  2. Change the storage directory of the NodeManager role.

    1. Choose Cluster > Name of the desired cluster > Service > Yarn > Stop to stop the Yarn service.
    2. Log in to each data node where the Yarn service is installed as user root and perform the following operations:
      1. Create a target directory.

        For example, to create the target directory ${BIGDATA_DATA_HOME}/yarn/data2, run the following command:

        mkdir ${BIGDATA_DATA_HOME}/yarn/data2

      2. Mount the target directory to the new disk.

        For example, mount ${BIGDATA_DATA_HOME}/yarn/data2 to the new disk.

      3. Modify permissions on the new directory.

        For example, to modify permissions on the ${BIGDATA_DATA_HOME}/yarn/data2 directory, run the following commands:

        chmod 750 ${BIGDATA_DATA_HOME}/yarn/data2 -R and chown omm:wheel ${BIGDATA_DATA_HOME}/yarn/data2 -R

    3. On the Manager portal, choose Cluster > Name of the desired cluster > Services > Yarn > Instance. Select the NodeManager instance of the corresponding host, click Instance Configuration, and select All Configurations.

      Change the value of yarn.nodemanager.local-dirs or yarn.nodemanager.log-dirs to the new target directory, for example, ${BIGDATA_DATA_HOME}/yarn/data2.

    4. Click Save, and then click OK. Restart the Yarn service.

      Click Finish when the system displays "Operation successful". Yarn is successfully started. No further action is required.

  3. Change the storage directory of a single NodeManager instance.

    1. Choose Cluster > Name of the desired cluster > Service > Yarn > Instance, select the NodeManager instance whose storage directory needs to be modified, and choose More > Stop.
    2. Log in to the NodeManager node as user root, and perform the following operations:
      1. Create a target directory.

        For example, to create the target directory ${BIGDATA_DATA_HOME}/yarn/data2, run the following command:

        mkdir ${BIGDATA_DATA_HOME}/yarn/data2

      2. Mount the target directory to the new disk.

        For example, mount ${BIGDATA_DATA_HOME}/yarn/data2 to the new disk.

      3. Modify permissions on the new directory.

        For example, to modify permissions on the ${BIGDATA_DATA_HOME}/yarn/data2 directory, run the following commands:

        chmod 750 ${BIGDATA_DATA_HOME}/yarn/data2 -R and chown omm:wheel ${BIGDATA_DATA_HOME}/yarn/data2 -R

    3. On Manager, click the specified NodeManager instance, and switch to the Instance Configuration page.

      Change the value of yarn.nodemanager.local-dirs or yarn.nodemanager.log-dirs to the new target directory, for example, ${BIGDATA_DATA_HOME}/yarn/data2.

    4. Click Save, and then click OK to restart the NodeManager instance.

      Click Finish when the system displays "Operation successful". The NodeManager instance is successfully started.