You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2022/03/31 22:35:50 UTC

[GitHub] [accumulo-testing] ctubbsii commented on a change in pull request #200: Wait for the NameNode to leave safemode before init'ing Accumulo

ctubbsii commented on a change in pull request #200:
URL: https://github.com/apache/accumulo-testing/pull/200#discussion_r840078955



##########
File path: contrib/terraform-testing-infrastructure/modules/config-files/templates/initialize_hadoop.sh.tftpl
##########
@@ -28,9 +28,15 @@ pdsh -S -g worker sudo systemctl enable hadoop-datanode yarn-nodemanager
 # 3. Start the namenode
 # 4. Start the resource manager
 # 5. Start datanodes and nodemanagers on the worker nodes
+# 6. Wait for the namenode to leave safemode
 #
 sudo systemctl start zookeeper
 hdfs namenode -format
 sudo systemctl start hadoop-namenode
 sudo systemctl start yarn-resourcemanager
 pdsh -S -g worker 'sudo systemctl start hadoop-datanode yarn-nodemanager'
+echo "Waiting for NameNode to leave safemode..."
+while [[ ! $(hdfs dfsadmin -safemode wait) ]]; do

Review comment:
       Alternatively:
   
   ```suggestion
   echo "Waiting for NameNode to leave safemode..."
   while [[ ! $(hdfs dfsadmin -safemode wait 2>/dev/null) =~ OFF ]]; do
     sleep 5
     echo "Waiting for NameNode to leave safemode..."
   done
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org