lirui-apache commented on a change in pull request #10709: [FLINK-13437][test] 
Add Hive SQL E2E test
URL: https://github.com/apache/flink/pull/10709#discussion_r365152997
 
 

 ##########
 File path: 
flink-end-to-end-tests/flink-connector-hive-test/src/main/resources/docker-hive-hadoop-cluster/bootstrap.sh
 ##########
 @@ -0,0 +1,87 @@
+#!/bin/bash
+################################################################################
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+################################################################################
+
+: ${HADOOP_PREFIX:=/usr/local/hadoop}
+
+$HADOOP_PREFIX/etc/hadoop/hadoop-env.sh
+
+MAX_RETRY_SECONDS=800
+
+# installing libraries if any - (resource urls added comma separated to the 
ACP system variable)
+cd $HADOOP_PREFIX/share/hadoop/common ; for cp in ${ACP//,/ }; do  echo == 
$cp; curl -LO $cp ; done; cd -
+
+sed -i 
"s#/usr/local/hadoop/bin/container-executor#${NM_CONTAINER_EXECUTOR_PATH}#g" 
$HADOOP_PREFIX/etc/hadoop/yarn-site.xml
+export HADOOP_CLASSPATH=`hadoop classpath`
+
+service ssh start
+
+if [ "$1" == "--help" -o "$1" == "-h" ]; then
+    echo "Usage: $(basename $0) (master|worker|hive)"
+    exit 0
+elif [ "$1" == "master" ]; then
+    yes| sudo -E -u hdfs $HADOOP_PREFIX/bin/hdfs namenode -format
+
+    nohup sudo -E -u hdfs $HADOOP_PREFIX/bin/hdfs namenode 2>> 
/var/log/hadoop/namenode.err >> /var/log/hadoop/namenode.out &
+    nohup sudo -E -u yarn $HADOOP_PREFIX/bin/yarn resourcemanager 2>> 
/var/log/hadoop/resourcemanager.err >> /var/log/hadoop/resourcemanager.out &
+    nohup sudo -E -u yarn $HADOOP_PREFIX/bin/yarn timelineserver 2>> 
/var/log/hadoop/timelineserver.err >> /var/log/hadoop/timelineserver.out &
+    nohup sudo -E -u mapred $HADOOP_PREFIX/bin/mapred historyserver 2>> 
/var/log/hadoop/historyserver.err >> /var/log/hadoop/historyserver.out &
+
+    hdfs dfsadmin -safemode wait
+    while [ $? -ne 0 ]; do hdfs dfsadmin -safemode wait; done
 
 Review comment:
   Why do we want to retry if the command fails? I think it's a potential 
infinite loop if something goes wrong.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to