You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by se...@apache.org on 2018/03/09 12:47:42 UTC

flink git commit: [FLINK-8091] [scripts] Support running historyserver in foreground

Repository: flink
Updated Branches:
  refs/heads/master 5eae8bd42 -> 69b329962


[FLINK-8091] [scripts] Support running historyserver in foreground

This closes #5642


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/69b32996
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/69b32996
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/69b32996

Branch: refs/heads/master
Commit: 69b3299623e1dec8c67d384e57d67343e2f4c215
Parents: 5eae8bd
Author: Andreas Fink <an...@noris.de>
Authored: Mon Mar 5 18:26:57 2018 +0100
Committer: Stephan Ewen <se...@apache.org>
Committed: Fri Mar 9 13:47:08 2018 +0100

----------------------------------------------------------------------
 docs/monitoring/historyserver.md                   |  2 +-
 flink-dist/src/main/flink-bin/bin/flink-console.sh |  6 +++++-
 flink-dist/src/main/flink-bin/bin/historyserver.sh | 10 +++++++---
 3 files changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/69b32996/docs/monitoring/historyserver.md
----------------------------------------------------------------------
diff --git a/docs/monitoring/historyserver.md b/docs/monitoring/historyserver.md
index dfbbc8e..9c68e65 100644
--- a/docs/monitoring/historyserver.md
+++ b/docs/monitoring/historyserver.md
@@ -37,7 +37,7 @@ After you have configured the HistoryServer *and* JobManager, you start and stop
 
 ```sh
 # Start or stop the HistoryServer
-bin/historyserver.sh (start|stop)
+bin/historyserver.sh (start|start-foreground|stop)
 ```
 
 By default, this server binds to `localhost` and listens at port `8082`.

http://git-wip-us.apache.org/repos/asf/flink/blob/69b32996/flink-dist/src/main/flink-bin/bin/flink-console.sh
----------------------------------------------------------------------
diff --git a/flink-dist/src/main/flink-bin/bin/flink-console.sh b/flink-dist/src/main/flink-bin/bin/flink-console.sh
index 574376c..3ccbbd0 100644
--- a/flink-dist/src/main/flink-bin/bin/flink-console.sh
+++ b/flink-dist/src/main/flink-bin/bin/flink-console.sh
@@ -19,7 +19,7 @@
 
 # Start a Flink service as a console application. Must be stopped with Ctrl-C
 # or with SIGTERM by kill or the controlling process.
-USAGE="Usage: flink-console.sh (jobmanager|taskmanager|zookeeper) [args]"
+USAGE="Usage: flink-console.sh (jobmanager|taskmanager|historyserver|zookeeper) [args]"
 
 SERVICE=$1
 ARGS=("${@:2}") # get remaining arguments as array
@@ -42,6 +42,10 @@ case $SERVICE in
         CLASS_TO_RUN=org.apache.flink.runtime.taskexecutor.TaskManagerRunner
     ;;
 
+    (historyserver)
+        CLASS_TO_RUN=org.apache.flink.runtime.webmonitor.history.HistoryServer
+    ;;
+
     (zookeeper)
         CLASS_TO_RUN=org.apache.flink.runtime.zookeeper.FlinkZooKeeperQuorumPeer
     ;;

http://git-wip-us.apache.org/repos/asf/flink/blob/69b32996/flink-dist/src/main/flink-bin/bin/historyserver.sh
----------------------------------------------------------------------
diff --git a/flink-dist/src/main/flink-bin/bin/historyserver.sh b/flink-dist/src/main/flink-bin/bin/historyserver.sh
index adc9660..150ab94 100644
--- a/flink-dist/src/main/flink-bin/bin/historyserver.sh
+++ b/flink-dist/src/main/flink-bin/bin/historyserver.sh
@@ -18,7 +18,7 @@
 ################################################################################
 
 # Start/stop a Flink HistoryServer
-USAGE="Usage: historyserver.sh (start|stop)"
+USAGE="Usage: historyserver.sh (start|start-foreground|stop)"
 
 STARTSTOP=$1
 
@@ -27,8 +27,12 @@ bin=`cd "$bin"; pwd`
 
 . "$bin"/config.sh
 
-if [[ $STARTSTOP == "start" ]]; then
+if [[ $STARTSTOP == "start" ]] || [[ $STARTSTOP == "start-foreground" ]]; then
 	args=("--configDir" "${FLINK_CONF_DIR}")
 fi
 
-"${FLINK_BIN_DIR}"/flink-daemon.sh $STARTSTOP historyserver "${args[@]}"
+if [[ $STARTSTOP == "start-foreground" ]]; then
+    exec "${FLINK_BIN_DIR}"/flink-console.sh historyserver "${args[@]}"
+else
+    "${FLINK_BIN_DIR}"/flink-daemon.sh $STARTSTOP historyserver "${args[@]}"
+fi