-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix resource manager docker waiting for namenode
- Loading branch information
1 parent
67479b7
commit fc272d1
Showing
2 changed files
with
19 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,3 @@ | ||
#!/bin/bash | ||
|
||
check_namenode() { | ||
echo "Checking if namenode is ready" | ||
safe_mode_status=$(hdfs dfsadmin -safemode get | grep 'Safe mode is OFF') | ||
if [[ $safe_mode_status == *"Safe mode is OFF"* ]]; then | ||
echo "NameNode is out of Safe Mode." | ||
return 0 | ||
else | ||
echo "NameNode is still in Safe Mode. Waiting..." | ||
return 1 | ||
fi | ||
} | ||
|
||
# Wait for NameNode to leave Safe Mode | ||
until check_namenode; do | ||
sleep 30 | ||
done | ||
|
||
echo "Starting ResourceManager..." | ||
|
||
$HADOOP_HOME/bin/yarn --config $HADOOP_CONF_DIR nodemanager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,22 @@ | ||
#!/bin/bash | ||
|
||
check_namenode() { | ||
echo "Checking if namenode is ready" | ||
safe_mode_status=$(hdfs dfsadmin -safemode get | grep 'Safe mode is OFF') | ||
if [[ $safe_mode_status == *"Safe mode is OFF"* ]]; then | ||
echo "NameNode is out of Safe Mode." | ||
return 0 | ||
else | ||
echo "NameNode is still in Safe Mode. Waiting..." | ||
return 1 | ||
fi | ||
} | ||
|
||
# Wait for NameNode to leave Safe Mode | ||
until check_namenode; do | ||
sleep 30 | ||
done | ||
|
||
echo "Starting ResourceManager..." | ||
|
||
$HADOOP_HOME/bin/yarn --config $HADOOP_CONF_DIR resourcemanager |