Skip to content

Commit 7e368db

Browse files
committed
Use port parameters in install scripts
1 parent 94b0eec commit 7e368db

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

resources/tools/flink-local-cluster.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
set -e
55

66
INSTALL_ONLY=0
7+
PORT=""
78
# Loop through arguments and process them: https://pretzelhands.com/posts/command-line-flags
89
for arg in "$@"; do
910
case $arg in
1011
-i|--install) INSTALL_ONLY=1 ; shift ;;
12+
-p=*|--port=*) PORT="${arg#*=}" ; shift ;; # TODO Does not allow --port 1234
1113
*) break ;;
1214
esac
1315
done

resources/tools/omnidb.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
set -e
55

66
INSTALL_ONLY=0
7+
PORT=""
78
# Loop through arguments and process them: https://pretzelhands.com/posts/command-line-flags
89
for arg in "$@"; do
910
case $arg in
1011
-i|--install) INSTALL_ONLY=1 ; shift ;;
12+
-p=*|--port=*) PORT="${arg#*=}" ; shift ;; # TODO Does not allow --port 1234
1113
*) break ;;
1214
esac
1315
done

resources/tools/pgadmin.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
set -e
55

66
INSTALL_ONLY=0
7+
PORT=""
78
# Loop through arguments and process them: https://pretzelhands.com/posts/command-line-flags
89
for arg in "$@"; do
910
case $arg in
1011
-i|--install) INSTALL_ONLY=1 ; shift ;;
12+
-p=*|--port=*) PORT="${arg#*=}" ; shift ;; # TODO Does not allow --port 1234
1113
*) break ;;
1214
esac
1315
done

resources/tools/spark-local-cluster.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
set -e
55

66
INSTALL_ONLY=0
7+
PORT=""
78
# Loop through arguments and process them: https://pretzelhands.com/posts/command-line-flags
89
for arg in "$@"; do
910
case $arg in
1011
-i|--install) INSTALL_ONLY=1 ; shift ;;
12+
-p=*|--port=*) PORT="${arg#*=}" ; shift ;; # TODO Does not allow --port 1234
1113
*) break ;;
1214
esac
1315
done
@@ -124,13 +126,16 @@ if [ $INSTALL_ONLY = 0 ] ; then
124126
read -p "Please provide a port for starting a local Spark cluster: " PORT
125127
fi
126128

127-
echo "Starting local Spark cluster on port "$PORT
129+
echo "Starting local Spark Master with WebUI on port "$PORT
128130
echo "spark.ui.proxyBase /tools/"$PORT >> $SPARK_HOME/conf/spark-defaults.conf;
129-
130131
$SPARK_HOME/sbin/stop-master.sh
131-
$SPARK_HOME/sbin/start-master.sh --webui-port $PORT
132+
$SPARK_HOME/sbin/start-master.sh --webui-port $PORT --host 0.0.0.0 --port 7077
133+
# Connect Slaves
134+
echo "Starting local Spark Worker with WebUI on port 7066"
135+
$SPARK_HOME/sbin/stop-slave.sh
136+
$SPARK_HOME/sbin/start-slave.sh spark://0.0.0.0:7077 --webui-port 7066 --host 0.0.0.0
132137
echo "Spark cluster is started. To access the dashboard, use the link in the open tools menu."
133-
echo '{"id": "spark-link", "name": "Spark", "url_path": "/tools/'$PORT'/", "description": "Apache Spark Dashboard"}' > $HOME/.workspace/tools/spark.json
138+
echo '{"id": "spark-link", "name": "Spark Master", "url_path": "/tools/'$PORT'/", "description": "Apache Spark Master Dashboard"}' > $HOME/.workspace/tools/spark.json
134139
sleep 20
135140
fi
136141

0 commit comments

Comments
 (0)