Fixes #3 Check if application is running before starting (#5)
* Also improved README.md
diff --git a/README.md b/README.md
index 6d9604b..2080c7a 100644
--- a/README.md
+++ b/README.md
@@ -34,7 +34,7 @@
## Set up your Fluo application
-Before you can launch a Fluo application in YARN, you should follow Fluo's [install instructions][install]
+Before you can launch a Fluo application in YARN, you should follow Fluo's [install] and [application] instructions
to install Fluo and initialize a Fluo application. After your application has been initialized, follow
the insructions below to install the Fluo YARN launcher and run your application in YARN. Avoid using the
`fluo` command to start local oracle and worker processes if you are running in YARN.
@@ -82,7 +82,8 @@
## Start Fluo application in YARN
-Follow the instructions below to start a Fluo application which contain an oracle and multiple workers.
+Follow the instructions below to start your application in YARN. If you have not done so already, you should [initialize
+your Fluo application][application] before following these instructions.
1. Configure [fluo-yarn-env.sh] and [fluo-yarn.properties] if you have not already.
@@ -90,13 +91,14 @@
fluo-yarn start myapp conf/fluo-yarn.properties
- The commands will retrieve your application configuration and observer jars (using your
- application name) before starting the application in YARN.
+ The commands will retrieve your application configuration and observer jars (using your application name) before
+ starting the application in YARN. The command will output a YARN application ID that can be used to find your
+ application in the YARN resource manager and view its logs.
## Manage Fluo application in YARN
Except for stopping your application in YARN, the `fluo` script can be used to manage your application using the
-`scan` and `wait` commands. See Fluo's [install instruction][install] for more information.
+`scan` and `wait` commands. See [Fluo's application instructions][application] for more information.
When you want you stop your Fluo application, use the the YARN resource manager or the
`yarn application -kill <App ID>` to stop the application in YARN.
@@ -105,7 +107,8 @@
[YARN]: http://hadoop.apache.org/
[related]: https://fluo.apache.org/related-projects/
[related]: https://fluo.apache.org/related-projects/
-[install]: https://github.com/apache/incubator-fluo/blob/master/docs/install.md
+[install]: https://github.com/apache/fluo/blob/master/docs/install.md
+[application]: https://github.com/apache/fluo/blob/master/docs/applications.md
[release]: https://fluo.apache.org/download/
[fluo-yarn-env.sh]: distribution/conf/fluo-yarn-env.sh
[fluo-yarn.properties]: distribution/conf/fluo-yarn.properties
diff --git a/distribution/bin/fluo-yarn b/distribution/bin/fluo-yarn
index 367dec4..5c78307 100755
--- a/distribution/bin/fluo-yarn
+++ b/distribution/bin/fluo-yarn
@@ -88,6 +88,11 @@
print_usage
exit 1
fi
+ app_status=$($FLUO_HOME/bin/fluo status $app)
+ if [[ "$app_status" == "RUNNING" ]]; then
+ echo "Fluo appplication '$app' is already running!"
+ exit 1
+ fi
build_bundled_jar
java org.apache.fluo.yarn.core.FluoYarnLauncher "$FLUO_CONN_PROPS" "$3" "$conf/log4j.properties" "$app" "$app_dir/$bundled_jar"
;;