From 58870bc1e95f110889e7f50bf37e6d4160eedf25 Mon Sep 17 00:00:00 2001 From: Yiming Liu Date: Thu, 27 Oct 2016 15:24:15 +0800 Subject: [PATCH] KYLIN-2133: Check web server port availability when startup --- build/bin/kylin.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/build/bin/kylin.sh b/build/bin/kylin.sh index ad3a952..832add9 100644 --- a/build/bin/kylin.sh +++ b/build/bin/kylin.sh @@ -96,6 +96,15 @@ then kylin_rest_address=$KYLIN_REST_ADDRESS fi + kylin_rest_address_arr=(${kylin_rest_address//;/ }) + nc -z -w 5 ${kylin_rest_address_arr[0]} ${kylin_rest_address_arr[1]} 1>/dev/null 2>&1; nc_result=$? + if [ $nc_result -eq 0 ]; then + echo "port ${kylin_rest_address} is not available, could not start Kylin" + exit 1 + else + echo "port ${kylin_rest_address} is available" + fi + #debug if encounter NoClassDefError echo "hbase classpath is:" hbase classpath -- 2.8.4 (Apple Git-73)