Skip to content

Commit

Permalink
update resource manager starting script
Browse files Browse the repository at this point in the history
  • Loading branch information
thanh-nguyen-dang committed Aug 26, 2024
1 parent ef825c6 commit 30d0309
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions hadoop/nodemanager/run.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
#!/bin/bash

check_namenode() {
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 10
done

echo "Starting ResourceManager..."

$HADOOP_HOME/bin/yarn --config $HADOOP_CONF_DIR nodemanager

0 comments on commit 30d0309

Please sign in to comment.