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:
- Reconfigure the JournalNode Edits Directory.
- Go to the HDFS service in Cloudera Manager.
- Click JournalNode under Status Summary.
- Click the JournalNode link for the instance you are changing.
- Click the Configuration tab.
- Set dfs.journalnode.edits.dir to the path of the new jn directory.
- Click Save Changes.
- Move the location of the JournalNode (jn) directory at the command line:
- Connect to host of the JournalNode.
- 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
- Rename the old jn directory to avoid confusion:
mv /<old_path_to_jn_dir>/jn /<old_path_to_jn_dir>/jn_to_delete
- Redeploy the HDFS client configuration:
- Go to the HDFS service.
- Select .
- Perform a Rolling Restart for HDFS by selecting . Use the default settings.
- From the command line, delete the old jn_to_delete directory.
Moving the JournalNode Edits Directory for a Role Group Using Cloudera Manager
- Stop all services on the cluster in Cloudera Manager:
- Go to the Cluster.
- Select .
- Find the list of JournalNode hosts:
- Go to the HDFS service.
- Click JournalNode under Status Summary.
- Move the location of each JournalNode (jn) directory at the command line:
- Connect to each host with a JournalNode.
- 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
- 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
- Reconfigure the JournalNode Default Group:
- Go to the HDFS service.
- Click the Configuration tab.
- Click JournalNode under Scope.
- Set dfs.journalnode.edits.dir to the path of the new jn directory for all JournalNodes in the group.
- Click Save Changes.
- Redeploy the client configuration for the cluster:
- Go to the Cluster.
- Select .
- Start all services on the cluster by selecting .
- Delete the old jn_to_delete directories from the command line.
Moving JournalNodes Across Hosts
To move JournalNodes to a new host, see Moving Highly Available NameNode, Failover Controller, and JournalNode Roles Using the Migrate Roles Wizard.
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.
- Go to the HDFS service.
- Click the Instances tab.
- Click the link labeled NameNode (Active).
The NameNode instance page displays.
- Go to the Process tab.
- 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.
- 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
- Return to the HDFS service page and click the Configuration tab.
- Search for the HDFS Service Advanced Configuration Snippet (Safety Valve) for hdfs-site.xml configuration option.
- Add the key dfs.namenode.shared.edits.dir to the selected configuration option and provide the value noted in Step 6.
- Click Save Changes.
- Restart HDFS.