JournalNodes

High-availability clusters use JournalNodes to synchronize active and standby NameNodes. The active NameNode writes to each JournalNode with changes, or "edits," to HDFS namespace metadata. During failover, the standby NameNode applies all edits from the JournalNodes before promoting itself to the active state.

Moving the JournalNode Edits Directory

Moving the JournalNode Edits Directory for an Role Instance Using Cloudera Manager

To change the location of the edits directory for one JournalNode instance:

  1. Reconfigure the JournalNode Edits Directory.
    1. Go to the HDFS service in Cloudera Manager.
    2. Click JournalNode under Status Summary.
    3. Click the JournalNode link for the instance you are changing.
    4. Click the Configuration tab.
    5. Set dfs.journalnode.edits.dir to the path of the new jn directory.
    6. Click Save Changes.
  2. Move the location of the JournalNode (jn) directory at the command line:
    1. Connect to host of the JournalNode.
    2. Copy the JournalNode (jn) directory to its new location with the -a option to preserve permissions:
      cp -a /<old_path_to_jn_dir>/jn /<new_path_to_jn_dir>/jn
    3. Rename the old jn directory to avoid confusion:
      mv /<old_path_to_jn_dir>/jn /<old_path_to_jn_dir>/jn_to_delete
  3. Redeploy the HDFS client configuration:
    1. Go to the HDFS service.
    2. Select Actions > Deploy Client Configuration.
  4. Perform a Rolling Restart for HDFS by selecting Actions > Rolling Restart. Use the default settings.
  5. From the command line, delete the old jn_to_delete directory.

Moving the JournalNode Edits Directory for a Role Group Using Cloudera Manager

To change the location of the edits directory for each JournalNode in the JournalNode Default Group:
  1. Stop all services on the cluster in Cloudera Manager:
    1. Go to the Cluster.
    2. Select Actions > Stop.
  2. Find the list of JournalNode hosts:
    1. Go to the HDFS service.
    2. Click JournalNode under Status Summary.
  3. Move the location of each JournalNode (jn) directory at the command line:
    1. Connect to each host with a JournalNode.
    2. Per host, copy the JournalNode (jn) directory to its new location with the -a option to preserve permissions:
      cp -a /<old_path_to_jn_dir>/jn /<new_path_to_jn_dir>/jn
    3. Per host, rename the old jn directory to avoid confusion:
      mv /<old_path_to_jn_dir>/jn /<old_path_to_jn_dir>/jn_to_delete
  4. Reconfigure the JournalNode Default Group:
    1. Go to the HDFS service.
    2. Click the Configuration tab.
    3. Click JournalNode under Scope.
    4. Set dfs.journalnode.edits.dir to the path of the new jn directory for all JournalNodes in the group.
    5. Click Save Changes.
  5. Redeploy the client configuration for the cluster:
    1. Go to the Cluster.
    2. Select Actions > Deploy Client Configuration.
  6. Start all services on the cluster by selecting Actions > Start.
  7. Delete the old jn_to_delete directories from the command line.

Moving JournalNodes Across Hosts

Synchronizing the contents of JournalNodes

You can synchronize the contents of the JournalNodes in your CDH cluster. Enabling this capability helps in maintaining consistency in the contents of all the JournalNodes across the cluster. For example, a JournalNode whose contents go out of synchronization can automatically copy the contents of the other JournalNodes in the cluster to ensure consistency.

To enable the synchronization of JournalNodes across the cluster using Cloudera Manager:
  1. Go to the HDFS service.
  2. Click the Instances tab.
  3. Click the link labeled NameNode (Active).

    The NameNode instance page displays.

  4. Go to the Process tab.
  5. Click the hdfs-site.xml link under hdfs/hdfs.sh ["namenode"] to open a read-only copy of the file in a separate browser window.
  6. Note the URI value set for JournalNodes in the various dfs.namenode.shared.edits.dir parameters.
    The URI value should be in the format:
    qjournal://host1:port1;host2:port2;host3:port3/journalId
  7. Return to the HDFS service page and click the Configuration tab.
  8. Search for the HDFS Service Advanced Configuration Snippet (Safety Valve) for hdfs-site.xml configuration option.
  9. Add the key dfs.namenode.shared.edits.dir to the selected configuration option and provide the value noted in Step 6.
  10. Click Save Changes.
  11. Restart HDFS.