Fix hadoop docker copy script (#10671)

This commit is contained in:
Abhishek Agarwal 2020-12-15 12:38:50 +05:30 committed by GitHub
parent ac1882bf74
commit 7a8e9bb156
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 3 deletions

View File

@ -14,17 +14,27 @@
# See the License for the specific language governing permissions and
# limitations under the License.
set -e
# wait for hadoop namenode to be up
echo "Waiting for hadoop namenode to be up"
MAX_ITERATIONS=15
i=1
docker exec -t druid-it-hadoop sh -c "./usr/local/hadoop/bin/hdfs dfs -mkdir -p /druid"
while [ $? -ne 0 ]
while [ $? -ne 0 ] && [ $i -lt $MAX_ITERATIONS ]
do
sleep 2
i=$((i+1))
docker exec -t druid-it-hadoop sh -c "./usr/local/hadoop/bin/hdfs dfs -mkdir -p /druid"
done
echo "Finished waiting for Hadoop namenode"
if [ $i -lt $MAX_ITERATIONS ]; then
echo "Hadoop namenode is up after $i iterations"
else
echo "Exhausted all runs while waiting for namenode to be up. Exiting"
exit 1
fi
set -e
# Setup hadoop druid dirs
echo "Setting up druid hadoop dirs"