If the JournalNode becomes abnormal on only one node in your cluster, you can restore the component from another node. This topic describes how to restore the abnormal JournalNode on a node from another node.

Procedure

  1. Find a healthy JournalNode.
    You can view the status of JournalNodes on the web user interface (UI) of Hadoop Distributed File System (HDFS). For more information, see Web UIs of HDFS components.
  2. Log on to the node on which the healthy JournalNode resides. We recommend that you select a header or master node. Then, package the files used to restore data.
    For more information about how to log on to a node, see Log on to a cluster.
    1. Switch to the hdfs user.
      su hdfs
    2. Go to the directory in which the files used to restore data are stored.
      cd /mnt/disk1/hdfs/journal/emr-cluster/
    3. Package the files.
      tar --exclude='edits*' -zcvf /tmp/jn-current.tar.gz current
      The following example shows the expected output:
      current/
      current/last-writer-epoch
      current/VERSION
      current/last-promised-epoch
      current/paxos/
      current/committed-txid
  3. Synchronize the jn-current.tar.gz package to the node on which the abnormal JournalNode resides.
    1. Switch to the emr-user user.
      su emr-user
      If the emr-user user does not exist in a cluster of E-MapReduce (EMR) V3.41.0, EMR V5.7.0, or a minor version earlier than EMR V3.41.0 or EMR V5.7.0, you can switch to the hadoop user.
      su hadoop
    2. Synchronize the package.
      scp /tmp/jn-current.tar.gz $unhealthy-journal-node:/tmp/

      Replace the value of the $unhealthy-journal-node variable with the hostname of the node on which the abnormal JournalNode resides.

  4. Stop the abnormal JournalNode on the HDFS node in the EMR console. Then, log on to the node on which the abnormal JournalNode resides and restore the JournalNode.
    1. Switch to the hdfs user.
      su hdfs
    2. Back up the current folder.
      cd /mnt/disk1/hdfs/journal/emr-cluster/
      mv current current.bak
    3. Restore the JournalNode.
      tar -xvf /tmp/jn-current.tar.gz
  5. Start the restored JournalNode on the HDFS node in the EMR console and view the logs of the JournalNode.
    For more information about logs, see HDFS service logs.
  6. View the status of the restored JournalNode on the web UI of HDFS. If data can be written to the JournalNode, the restoration is successful. In this case, you can clear the current.bak file that is generated to back up the current folder.
    You can check whether data can be written to the JournalNode on the web UI of HDFS. For more information, see Web UIs of HDFS components.