You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2012/03/28 06:59:29 UTC
svn commit: r1306170 - in /incubator/mesos/trunk/src/deploy:
mesos-daemon.sh.in mesos-start-cluster.sh.in mesos-start-masters.sh.in
mesos-start-slaves.sh.in mesos-stop-cluster.sh.in mesos-stop-masters.sh.in
mesos-stop-slaves.sh.in
Author: benh
Date: Wed Mar 28 04:59:28 2012
New Revision: 1306170
URL: http://svn.apache.org/viewvc?rev=1306170&view=rev
Log:
Forgot to add new files.
Added:
incubator/mesos/trunk/src/deploy/mesos-daemon.sh.in
incubator/mesos/trunk/src/deploy/mesos-start-cluster.sh.in
incubator/mesos/trunk/src/deploy/mesos-start-masters.sh.in
incubator/mesos/trunk/src/deploy/mesos-start-slaves.sh.in
incubator/mesos/trunk/src/deploy/mesos-stop-cluster.sh.in
incubator/mesos/trunk/src/deploy/mesos-stop-masters.sh.in
incubator/mesos/trunk/src/deploy/mesos-stop-slaves.sh.in
Added: incubator/mesos/trunk/src/deploy/mesos-daemon.sh.in
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/deploy/mesos-daemon.sh.in?rev=1306170&view=auto
==============================================================================
--- incubator/mesos/trunk/src/deploy/mesos-daemon.sh.in (added)
+++ incubator/mesos/trunk/src/deploy/mesos-daemon.sh.in Wed Mar 28 04:59:28 2012
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+
+# Increase the default number of open file descriptors.
+ulimit -n 8192
+
+PROGRAM=${1}
+
+shift # Remove PROGRAM from the argument list (since we pass ${@} below).
+
+nohup @sbindir@/${PROGRAM} \
+ --conf=@localstatedir@/mesos/conf ${@} </dev/null >/dev/null 2>&1 &
Added: incubator/mesos/trunk/src/deploy/mesos-start-cluster.sh.in
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/deploy/mesos-start-cluster.sh.in?rev=1306170&view=auto
==============================================================================
--- incubator/mesos/trunk/src/deploy/mesos-start-cluster.sh.in (added)
+++ incubator/mesos/trunk/src/deploy/mesos-start-cluster.sh.in Wed Mar 28 04:59:28 2012
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+
+DEPLOY_DIR=@localstatedir@/@PACKAGE@/deploy
+
+# Pull in deploy specific options.
+test -e ${DEPLOY_DIR}/mesos-deploy-env.sh && \
+ . ${DEPLOY_DIR}/mesos-deploy-env.sh
+
+function usage() {
+ echo "Usage: mesos-start-cluster.sh [-h] [-s]"
+ echo " -h display this message"
+ echo " -s use sudo to start mesos-master and mesos-slave"
+ if test ${#} -gt 0; then
+ echo
+ echo "${@}"
+ fi
+ exit 1
+}
+
+while getopts "hs" opt
+do
+ case ${opt} in
+ h) usage ;;
+ s) export DEPLOY_WITH_SUDO=1 ;;
+ *) usage "Invalid option: -${OPTARG}" ;;
+ esac
+done
+
+@sbindir@/mesos-start-masters.sh && sleep 1 && @sbindir@/mesos-start-slaves.sh
+
+# TODO(benh): Check the health of the masters (and possibly slaves)
+# and print the masters webui address (or just the leading master).
+
+echo "Everything's started!"
\ No newline at end of file
Added: incubator/mesos/trunk/src/deploy/mesos-start-masters.sh.in
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/deploy/mesos-start-masters.sh.in?rev=1306170&view=auto
==============================================================================
--- incubator/mesos/trunk/src/deploy/mesos-start-masters.sh.in (added)
+++ incubator/mesos/trunk/src/deploy/mesos-start-masters.sh.in Wed Mar 28 04:59:28 2012
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+
+DEPLOY_DIR=@localstatedir@/@PACKAGE@/deploy
+
+# Pull in deploy specific options.
+test -e ${DEPLOY_DIR}/mesos-deploy-env.sh && \
+ . ${DEPLOY_DIR}/mesos-deploy-env.sh
+
+# Find the list of masters.
+MASTERS_FILE="${DEPLOY_DIR}/masters"
+if test ! -e ${MASTERS_FILE}; then
+ echo "Failed to find ${MASTERS_FILE}"
+ exit 1
+fi
+
+MASTERS=`cat ${MASTERS_FILE}`
+
+daemon="@sbindir@/mesos-daemon.sh"
+
+# Add sudo if requested.
+if test "x${DEPLOY_WITH_SUDO}" = "x1"; then
+ daemon="sudo ${daemon}"
+fi
+
+# Launch masters.
+for master in ${MASTERS}; do
+ echo "Starting mesos-master on ${master}"
+ echo ssh ${SSH_OPTS} ${master} "${daemon} mesos-master </dev/null >/dev/null"
+ ssh ${SSH_OPTS} ${master} "${daemon} mesos-master </dev/null >/dev/null" &
+ sleep 0.1
+done
+
+wait # Wait for all the ssh's to finish.
\ No newline at end of file
Added: incubator/mesos/trunk/src/deploy/mesos-start-slaves.sh.in
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/deploy/mesos-start-slaves.sh.in?rev=1306170&view=auto
==============================================================================
--- incubator/mesos/trunk/src/deploy/mesos-start-slaves.sh.in (added)
+++ incubator/mesos/trunk/src/deploy/mesos-start-slaves.sh.in Wed Mar 28 04:59:28 2012
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+
+DEPLOY_DIR=@localstatedir@/@PACKAGE@/deploy
+
+# Pull in deploy specific options.
+test -e ${DEPLOY_DIR}/mesos-deploy-env.sh && \
+ . ${DEPLOY_DIR}/mesos-deploy-env.sh
+
+# Find the list of slaves.
+SLAVES_FILE="${DEPLOY_DIR}/slaves"
+if test ! -e ${SLAVES_FILE}; then
+ echo "Failed to find ${SLAVES_FILE}"
+ exit 1
+fi
+
+SLAVES=`cat ${SLAVES_FILE}`
+
+daemon="@sbindir@/mesos-daemon.sh"
+
+# Add sudo if requested.
+if test "x${DEPLOY_WITH_SUDO}" = "x1"; then
+ daemon="sudo ${daemon}"
+fi
+
+# Launch slaves.
+for slave in ${SLAVES}; do
+ echo "Starting mesos-slave on ${slave}"
+ echo ssh ${SSH_OPTS} ${slave} "${daemon} mesos-slave </dev/null >/dev/null"
+ ssh ${SSH_OPTS} ${slave} "${daemon} mesos-slave </dev/null >/dev/null" &
+ sleep 0.1
+done
+
+wait # Wait for all the ssh's to finish.
\ No newline at end of file
Added: incubator/mesos/trunk/src/deploy/mesos-stop-cluster.sh.in
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/deploy/mesos-stop-cluster.sh.in?rev=1306170&view=auto
==============================================================================
--- incubator/mesos/trunk/src/deploy/mesos-stop-cluster.sh.in (added)
+++ incubator/mesos/trunk/src/deploy/mesos-stop-cluster.sh.in Wed Mar 28 04:59:28 2012
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+
+function usage() {
+ echo "Usage: mesos-stop-cluster.sh [-h] [-s]"
+ echo " -h display this message"
+ echo " -s use sudo to stop mesos-master and mesos-slave"
+ if test ${#} -gt 0; then
+ echo
+ echo "${@}"
+ fi
+ exit 1
+}
+
+while getopts "hs" opt
+do
+ case ${opt} in
+ h) usage ;;
+ s) export DEPLOY_WITH_SUDO=1 ;;
+ *) usage "Invalid option: -${OPTARG}" ;;
+ esac
+done
+
+@sbindir@/mesos-stop-slaves.sh && sleep 1 && @sbindir@/mesos-stop-masters.sh
+
+echo "Everything's stopped!"
\ No newline at end of file
Added: incubator/mesos/trunk/src/deploy/mesos-stop-masters.sh.in
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/deploy/mesos-stop-masters.sh.in?rev=1306170&view=auto
==============================================================================
--- incubator/mesos/trunk/src/deploy/mesos-stop-masters.sh.in (added)
+++ incubator/mesos/trunk/src/deploy/mesos-stop-masters.sh.in Wed Mar 28 04:59:28 2012
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+prefix=@prefix@
+
+DEPLOY_DIR=@localstatedir@/@PACKAGE@/deploy
+
+# Pull in deploy specific options.
+test -e ${DEPLOY_DIR}/mesos-deploy-env.sh && \
+ . ${DEPLOY_DIR}/mesos-deploy-env.sh
+
+# Find the list of masters.
+MASTERS_FILE="${DEPLOY_DIR}/masters"
+if test ! -e ${MASTERS_FILE}; then
+ echo "Failed to find ${MASTERS_FILE}"
+ exit 1
+fi
+
+MASTERS=`cat ${MASTERS_FILE}`
+
+killall="killall"
+
+# Add sudo if requested.
+if test "x${DEPLOY_WITH_SUDO}" = "x1"; then
+ killall="sudo ${killall}"
+fi
+
+for master in ${MASTERS}; do
+ echo "Stopping mesos-master on ${master}"
+ ssh ${SSH_OPTS} ${master} "${killall} mesos-master" &
+ sleep 0.1
+done
+
+wait # Wait for all the ssh's to finish.
Added: incubator/mesos/trunk/src/deploy/mesos-stop-slaves.sh.in
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/deploy/mesos-stop-slaves.sh.in?rev=1306170&view=auto
==============================================================================
--- incubator/mesos/trunk/src/deploy/mesos-stop-slaves.sh.in (added)
+++ incubator/mesos/trunk/src/deploy/mesos-stop-slaves.sh.in Wed Mar 28 04:59:28 2012
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+prefix=@prefix@
+DEPLOY_DIR=@localstatedir@/@PACKAGE@/deploy
+
+# Pull in deploy specific options.
+test -e ${DEPLOY_DIR}/mesos-deploy-env.sh && \
+ . ${DEPLOY_DIR}/mesos-deploy-env.sh
+
+# Find the list of slaves.
+SLAVES_FILE="${DEPLOY_DIR}/slaves"
+if test ! -e ${SLAVES_FILE}; then
+ echo "Failed to find ${SLAVES_FILE}"
+ exit 1
+fi
+
+SLAVES=`cat ${SLAVES_FILE}`
+
+killall="killall"
+
+# Add sudo if requested.
+if test "x${DEPLOY_WITH_SUDO}" = "x1"; then
+ killall="sudo ${killall}"
+fi
+
+for slave in ${SLAVES}; do
+ echo "Stopping mesos-slave on ${slave}"
+ ssh ${SSH_OPTS} ${slave} "${killall} mesos-slave" &
+ sleep 0.1
+done
+
+wait # Wait for all the ssh's to finish.