Moving Journal Node directory from one volume to another volume on the same Host
There are two sections which illustrate moving the Journal directory on the same Host.
You can follow one of the section according to your need.
Section 1: ( Service Downtime is not required )
1. Change the settings in Ambari for journal node edits directory(dfs.journalnode.edits.dir) from /hadoop/hdfs/journal/ to /data/1/journal/
2. Don't restart any services immediately.
3. Stop the journal node on NODE1.
a. SSH to NODE1
b. sudo mkdir -p /data/1/journal
c. sudo chown hdfs:hadoop /data/1/journal
d. sudo rsync -ahvAX /hadoop/hdfs/journal/* /data/1/journal/
Start the journal node on NODE1
4. Repeat step 3 for remaining two journal nodes NODE2 and NODE3.
5. Restart the required services accordingly (Rolling or All at once)
Section 2: ( Service Downtime is required )
1. Create the new directory on all Journal nodes.
Example:
# mkdir -p /data/1/journal/
2. Change ownership to "hdfs:hadoop" on all Journal nodes.
Example:
# chown hdfs:hadoop /data/1/journal/
3. Backup an exiting "Fsimage and Edits" from " dfs.namenode.name.dir", "dfs.journalnode.edits.dir" directory on both Namenode and all Journal nodes.
4. Active Namenode - Perform the saveNamespace which will Merge "FSImage and Edits".
# su - hdfs
$ hdfs dfsadmin -safemode enter
$ hdfs dfsadmin -saveNamespace
5. Stop Active Namenode and Standby Namenode.
6. Stop all Journal nodes.
6. Update, latest Journal node directory.
Ambari -> HDFS -> Configs -> Advanced -> Advanced hdfs-site -> dfs.journalnode.edits.dir
7. Start all Journal nodes.
8. Format JN directory.
# su - hdfs
$ hdfs namenode -initializeSharedEdits
Note: The command should be run on one of the Namenode hosts.
9. Start Active Namenode.
Note:
Don't proceed next step until Namenode out of Safemode.
10. Bootstrap Standby Namenode.
# su - hdfs
$ hdfs namenode -bootstrapStandby
Note:
The command should be run on Standby Namenode.
During, You will get the option to format the Storage directory. Press Y and hit enter.
Re-format filesystem in Storage Directory /hadoop/hdfs/namenode ? (Y or N) Y
11. Start Standby Namenode.

