You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whirr.apache.org by as...@apache.org on 2011/05/05 10:35:12 UTC
svn commit: r1099716 - in /incubator/whirr/trunk: ./
core/src/main/java/org/apache/whirr/actions/
core/src/main/resources/functions/
services/elasticsearch/src/main/java/org/apache/whirr/service/elasticsearch/
services/elasticsearch/src/main/resources/...
Author: asavu
Date: Thu May 5 08:35:11 2011
New Revision: 1099716
URL: http://svn.apache.org/viewvc?rev=1099716&view=rev
Log:
WHIRR-297. Separate ZooKeeper and ElasticSearch install and configuration scripts into more generic functions (asavu)
Added:
incubator/whirr/trunk/core/src/main/resources/functions/install_service.sh
incubator/whirr/trunk/core/src/main/resources/functions/remove_service.sh
incubator/whirr/trunk/services/elasticsearch/src/main/resources/functions/cleanup_elasticsearch.sh
incubator/whirr/trunk/services/elasticsearch/src/main/resources/functions/start_elasticsearch.sh
incubator/whirr/trunk/services/elasticsearch/src/main/resources/functions/stop_elasticsearch.sh
incubator/whirr/trunk/services/zookeeper/src/main/resources/functions/cleanup_zookeeper.sh
incubator/whirr/trunk/services/zookeeper/src/main/resources/functions/start_zookeeper.sh
incubator/whirr/trunk/services/zookeeper/src/main/resources/functions/stop_zookeeper.sh
Modified:
incubator/whirr/trunk/CHANGES.txt
incubator/whirr/trunk/core/src/main/java/org/apache/whirr/actions/ScriptBasedClusterAction.java
incubator/whirr/trunk/core/src/main/resources/functions/install_tarball.sh
incubator/whirr/trunk/services/elasticsearch/src/main/java/org/apache/whirr/service/elasticsearch/ElasticSearchHandler.java
incubator/whirr/trunk/services/elasticsearch/src/main/resources/functions/configure_elasticsearch.sh
incubator/whirr/trunk/services/elasticsearch/src/main/resources/functions/install_elasticsearch.sh
incubator/whirr/trunk/services/zookeeper/src/main/java/org/apache/whirr/service/zookeeper/ZooKeeperClusterActionHandler.java
incubator/whirr/trunk/services/zookeeper/src/main/resources/functions/configure_zookeeper.sh
incubator/whirr/trunk/services/zookeeper/src/main/resources/functions/install_zookeeper.sh
Modified: incubator/whirr/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/whirr/trunk/CHANGES.txt?rev=1099716&r1=1099715&r2=1099716&view=diff
==============================================================================
--- incubator/whirr/trunk/CHANGES.txt (original)
+++ incubator/whirr/trunk/CHANGES.txt Thu May 5 08:35:11 2011
@@ -56,6 +56,9 @@ Trunk (unreleased changes)
WHIRR-291. Add "noop" role useful just for provisioning (asavu)
+ WHIRR-297. Separate ZooKeeper and ElasticSearch install and configuration
+ scripts into more generic functions (asavu)
+
BUG FIXES
WHIRR-253. ZooKeeper service should only authorize ingress to ZooKeeper
Modified: incubator/whirr/trunk/core/src/main/java/org/apache/whirr/actions/ScriptBasedClusterAction.java
URL: http://svn.apache.org/viewvc/incubator/whirr/trunk/core/src/main/java/org/apache/whirr/actions/ScriptBasedClusterAction.java?rev=1099716&r1=1099715&r2=1099716&view=diff
==============================================================================
--- incubator/whirr/trunk/core/src/main/java/org/apache/whirr/actions/ScriptBasedClusterAction.java (original)
+++ incubator/whirr/trunk/core/src/main/java/org/apache/whirr/actions/ScriptBasedClusterAction.java Thu May 5 08:35:11 2011
@@ -60,12 +60,15 @@ public abstract class ScriptBasedCluster
Cluster newCluster = cluster;
for (InstanceTemplate instanceTemplate : clusterSpec.getInstanceTemplates()) {
StatementBuilder statementBuilder = new StatementBuilder();
+
ComputeServiceContext computServiceContext = // TODO: shouldn't create lots of these
ComputeServiceContextBuilder.build(getComputeServiceContextFactory(), clusterSpec);
FirewallManager firewallManager = new FirewallManager(computServiceContext,
clusterSpec, newCluster);
+
ClusterActionEvent event = new ClusterActionEvent(getAction(),
clusterSpec, newCluster, statementBuilder, firewallManager);
+
eventMap.put(instanceTemplate, event);
for (String role : instanceTemplate.getRoles()) {
ClusterActionHandler handler = handlerMap.get(role);
Added: incubator/whirr/trunk/core/src/main/resources/functions/install_service.sh
URL: http://svn.apache.org/viewvc/incubator/whirr/trunk/core/src/main/resources/functions/install_service.sh?rev=1099716&view=auto
==============================================================================
--- incubator/whirr/trunk/core/src/main/resources/functions/install_service.sh (added)
+++ incubator/whirr/trunk/core/src/main/resources/functions/install_service.sh Thu May 5 08:35:11 2011
@@ -0,0 +1,26 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+function install_service() {
+ if [ "$1" != "" ]; then
+ if which update-rc.d >/dev/null 2>&1; then
+ update-rc.d $1 defaults
+ fi
+ if which chkconfig >/dev/null 2>&1; then
+ chkconfig --add $1
+ fi
+ fi
+}
Modified: incubator/whirr/trunk/core/src/main/resources/functions/install_tarball.sh
URL: http://svn.apache.org/viewvc/incubator/whirr/trunk/core/src/main/resources/functions/install_tarball.sh?rev=1099716&r1=1099715&r2=1099716&view=diff
==============================================================================
--- incubator/whirr/trunk/core/src/main/resources/functions/install_tarball.sh (original)
+++ incubator/whirr/trunk/core/src/main/resources/functions/install_tarball.sh Thu May 5 08:35:11 2011
@@ -16,13 +16,16 @@
#
function install_tarball() {
if [[ "$1" != "" ]]; then
- # Download a .tar.gz file and extract to /usr/local
+ # Download a .tar.gz file and extract to target dir
local tar_url=$1
local tar_file=`basename $tar_url`
local tar_file_md5=`basename $tar_url.md5`
- local curl="curl --silent --show-error --fail --connect-timeout 10 --max-time 600"
+ local target=${2:-/usr/local/}
+ mkdir -p $target
+
+ local curl="curl -L --silent --show-error --fail --connect-timeout 10 --max-time 600 --retry 5"
# any download should take less than 10 minutes
for retry_count in `seq 1 3`;
@@ -54,7 +57,7 @@ function install_tarball() {
exit 1
fi
- tar xzf $tar_file -C /usr/local
+ tar xzf $tar_file -C $target
rm -f $tar_file $tar_file_md5
fi
}
Added: incubator/whirr/trunk/core/src/main/resources/functions/remove_service.sh
URL: http://svn.apache.org/viewvc/incubator/whirr/trunk/core/src/main/resources/functions/remove_service.sh?rev=1099716&view=auto
==============================================================================
--- incubator/whirr/trunk/core/src/main/resources/functions/remove_service.sh (added)
+++ incubator/whirr/trunk/core/src/main/resources/functions/remove_service.sh Thu May 5 08:35:11 2011
@@ -0,0 +1,26 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+function remove_service() {
+ if [ "$1" != "" ]; then
+ if which update-rc.d >/dev/null 2>&1; then
+ update-rc.d -f $1 remove
+ fi
+ if which chkconfig >/dev/null 2>&1; then
+ chkconfig --del $1
+ fi
+ fi
+}
Modified: incubator/whirr/trunk/services/elasticsearch/src/main/java/org/apache/whirr/service/elasticsearch/ElasticSearchHandler.java
URL: http://svn.apache.org/viewvc/incubator/whirr/trunk/services/elasticsearch/src/main/java/org/apache/whirr/service/elasticsearch/ElasticSearchHandler.java?rev=1099716&r1=1099715&r2=1099716&view=diff
==============================================================================
--- incubator/whirr/trunk/services/elasticsearch/src/main/java/org/apache/whirr/service/elasticsearch/ElasticSearchHandler.java (original)
+++ incubator/whirr/trunk/services/elasticsearch/src/main/java/org/apache/whirr/service/elasticsearch/ElasticSearchHandler.java Thu May 5 08:35:11 2011
@@ -52,6 +52,7 @@ public class ElasticSearchHandler extend
Configuration config = spec.getConfiguration();
addStatement(event, call("install_java"));
+ addStatement(event, call("install_tarball"));
String tarurl = prepareRemoteFileUrl(event,
config.getString("whirr.elasticsearch.tarball.url", ""));
@@ -74,5 +75,6 @@ public class ElasticSearchHandler extend
ElasticSearchConfigurationBuilder.build("/tmp/elasticsearch.yml", config));
addStatement(event, call("configure_elasticsearch",
config.getStringArray("es.plugins")));
+ addStatement(event, call("start_elasticsearch"));
}
}
Added: incubator/whirr/trunk/services/elasticsearch/src/main/resources/functions/cleanup_elasticsearch.sh
URL: http://svn.apache.org/viewvc/incubator/whirr/trunk/services/elasticsearch/src/main/resources/functions/cleanup_elasticsearch.sh?rev=1099716&view=auto
==============================================================================
--- incubator/whirr/trunk/services/elasticsearch/src/main/resources/functions/cleanup_elasticsearch.sh (added)
+++ incubator/whirr/trunk/services/elasticsearch/src/main/resources/functions/cleanup_elasticsearch.sh Thu May 5 08:35:11 2011
@@ -0,0 +1,24 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+function cleanup_elasticsearch() {
+ cd /usr/local/elasticsearch-*
+
+ ./bin/service/elasticsearch stop
+ ./bin/service/elasticsearch remove
+
+ rm -rf /usr/local/elasticsearch-*
+}
Modified: incubator/whirr/trunk/services/elasticsearch/src/main/resources/functions/configure_elasticsearch.sh
URL: http://svn.apache.org/viewvc/incubator/whirr/trunk/services/elasticsearch/src/main/resources/functions/configure_elasticsearch.sh?rev=1099716&r1=1099715&r2=1099716&view=diff
==============================================================================
--- incubator/whirr/trunk/services/elasticsearch/src/main/resources/functions/configure_elasticsearch.sh (original)
+++ incubator/whirr/trunk/services/elasticsearch/src/main/resources/functions/configure_elasticsearch.sh Thu May 5 08:35:11 2011
@@ -22,11 +22,9 @@ function configure_elasticsearch() {
./bin/plugin install $plugin
done
- cp /tmp/elasticsearch.yml config/elasticsearch.yml
-
- # use 80% of memory for jvm heap
- local MAXMEM=$(($(free|awk '/^Mem:/{print $2}') * 8 / 10 / 1024))m
+ # TODO allow user to set the amount of memory to use
+ # local MAXMEM=$(($(free|awk '/^Mem:/{print $2}') * 8 / 10 / 1024))m
- ./bin/elasticsearch -Xmx$MAXMEM -Xms$MAXMEM -p elasticsearch.pid
+ cp /tmp/elasticsearch.yml config/elasticsearch.yml
}
Modified: incubator/whirr/trunk/services/elasticsearch/src/main/resources/functions/install_elasticsearch.sh
URL: http://svn.apache.org/viewvc/incubator/whirr/trunk/services/elasticsearch/src/main/resources/functions/install_elasticsearch.sh?rev=1099716&r1=1099715&r2=1099716&view=diff
==============================================================================
--- incubator/whirr/trunk/services/elasticsearch/src/main/resources/functions/install_elasticsearch.sh (original)
+++ incubator/whirr/trunk/services/elasticsearch/src/main/resources/functions/install_elasticsearch.sh Thu May 5 08:35:11 2011
@@ -15,28 +15,21 @@
# limitations under the License.
#
function install_elasticsearch() {
- local CURL="curl -L --silent --show-error --fail --connect-timeout 10 --max-time 600 --retry 5"
+
+ # TODO Run ElasticSearch as non-root-user
+ # http://www.elasticsearch.org/tutorials/2011/02/22/running-elasticsearch-as-a-non-root-user.html
local ES_URL=${1:-http://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.15.2.tar.gz}
- local TAR_FILE=`basename $ES_URL`
+ install_tarball $ES_URL
- for retry_count in `seq 1 3`
- do
- $CURL -O $ES_URL || true
- if [ -f $TAR_FILE ]; then
- break;
- fi
- if [ ! $retry_count -eq "3" ]; then
- sleep 10
- fi
- done
+ # install the latest service wrapper for elasticsearch
+ local ES_WRAPPER=https://github.com/elasticsearch/elasticsearch-servicewrapper/tarball/master
+ install_tarball $ES_WRAPPER /tmp/
- if [ -f $TAR_FILE ]; then
- tar xzf $TAR_FILE -C /usr/local
- rm -f $TAR_FILE
- else
- echo "Unable to download tar file from $ES_URL" >&2
- exit 1
- fi
-}
+ # move the service wrapper in place
+ mv /tmp/elasticsearch-elasticsearch-servicewrapper-*/service /usr/local/elasticsearch-*/bin/
+ cd /usr/local/elasticsearch-*
+ # ensure that elasticsearch will start after reboot
+ ./bin/service/elasticsearch install
+}
Added: incubator/whirr/trunk/services/elasticsearch/src/main/resources/functions/start_elasticsearch.sh
URL: http://svn.apache.org/viewvc/incubator/whirr/trunk/services/elasticsearch/src/main/resources/functions/start_elasticsearch.sh?rev=1099716&view=auto
==============================================================================
--- incubator/whirr/trunk/services/elasticsearch/src/main/resources/functions/start_elasticsearch.sh (added)
+++ incubator/whirr/trunk/services/elasticsearch/src/main/resources/functions/start_elasticsearch.sh Thu May 5 08:35:11 2011
@@ -0,0 +1,20 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+function start_elasticsearch() {
+ cd /usr/local/elasticsearch-*
+ ./bin/service/elasticsearch start
+}
Added: incubator/whirr/trunk/services/elasticsearch/src/main/resources/functions/stop_elasticsearch.sh
URL: http://svn.apache.org/viewvc/incubator/whirr/trunk/services/elasticsearch/src/main/resources/functions/stop_elasticsearch.sh?rev=1099716&view=auto
==============================================================================
--- incubator/whirr/trunk/services/elasticsearch/src/main/resources/functions/stop_elasticsearch.sh (added)
+++ incubator/whirr/trunk/services/elasticsearch/src/main/resources/functions/stop_elasticsearch.sh Thu May 5 08:35:11 2011
@@ -0,0 +1,20 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+function stop_elasticsearch() {
+ cd /usr/local/elasticsearch-*
+ ./bin/service/elasticsearch stop
+}
Modified: incubator/whirr/trunk/services/zookeeper/src/main/java/org/apache/whirr/service/zookeeper/ZooKeeperClusterActionHandler.java
URL: http://svn.apache.org/viewvc/incubator/whirr/trunk/services/zookeeper/src/main/java/org/apache/whirr/service/zookeeper/ZooKeeperClusterActionHandler.java?rev=1099716&r1=1099715&r2=1099716&view=diff
==============================================================================
--- incubator/whirr/trunk/services/zookeeper/src/main/java/org/apache/whirr/service/zookeeper/ZooKeeperClusterActionHandler.java (original)
+++ incubator/whirr/trunk/services/zookeeper/src/main/java/org/apache/whirr/service/zookeeper/ZooKeeperClusterActionHandler.java Thu May 5 08:35:11 2011
@@ -63,6 +63,10 @@ public class ZooKeeperClusterActionHandl
addStatement(event, call("install_java"));
addStatement(event, call("install_tarball"));
+ /* register utility functions for managing init scripts */
+ addStatement(event, call("install_service"));
+ addStatement(event, call("remove_service"));
+
String tarurl = config.getString("whirr.zookeeper.tarball.url");
addStatement(event, call("install_zookeeper",
prepareRemoteFileUrl(event, tarurl)));
@@ -82,12 +86,14 @@ public class ZooKeeperClusterActionHandl
String servers = Joiner.on(' ').join(getPrivateIps(ensemble));
addStatement(event, call("configure_zookeeper", "-c",
clusterSpec.getProvider(), servers));
+ addStatement(event, call("start_zookeeper"));
}
@Override
protected void afterConfigure(ClusterActionEvent event) {
ClusterSpec clusterSpec = event.getClusterSpec();
Cluster cluster = event.getCluster();
+
LOG.info("Completed configuration of {}", clusterSpec.getClusterName());
String hosts = Joiner.on(',').join(getHosts(cluster.getInstancesMatching(
role(ZOOKEEPER_ROLE))));
Added: incubator/whirr/trunk/services/zookeeper/src/main/resources/functions/cleanup_zookeeper.sh
URL: http://svn.apache.org/viewvc/incubator/whirr/trunk/services/zookeeper/src/main/resources/functions/cleanup_zookeeper.sh?rev=1099716&view=auto
==============================================================================
--- incubator/whirr/trunk/services/zookeeper/src/main/resources/functions/cleanup_zookeeper.sh (added)
+++ incubator/whirr/trunk/services/zookeeper/src/main/resources/functions/cleanup_zookeeper.sh Thu May 5 08:35:11 2011
@@ -0,0 +1,23 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+function cleanup_zookeeper() {
+ /etc/init.d/zookeeper stop
+ remove_service zookeeper
+ # TODO remove cron job
+ rm -rf /usr/local/zookeeper* /etc/zookeeper /var/log/zookeeper /mnt/zookeeper
+ rm -f /etc/init.d/zookeeper
+}
Modified: incubator/whirr/trunk/services/zookeeper/src/main/resources/functions/configure_zookeeper.sh
URL: http://svn.apache.org/viewvc/incubator/whirr/trunk/services/zookeeper/src/main/resources/functions/configure_zookeeper.sh?rev=1099716&r1=1099715&r2=1099716&view=diff
==============================================================================
--- incubator/whirr/trunk/services/zookeeper/src/main/resources/functions/configure_zookeeper.sh (original)
+++ incubator/whirr/trunk/services/zookeeper/src/main/resources/functions/configure_zookeeper.sh Thu May 5 08:35:11 2011
@@ -77,8 +77,4 @@ EOF
fi
echo $myid > $myid_file
fi
-
- # Now that it's configured, start ZooKeeper
- nohup /etc/rc.local &
-
}
Modified: incubator/whirr/trunk/services/zookeeper/src/main/resources/functions/install_zookeeper.sh
URL: http://svn.apache.org/viewvc/incubator/whirr/trunk/services/zookeeper/src/main/resources/functions/install_zookeeper.sh?rev=1099716&r1=1099715&r2=1099716&view=diff
==============================================================================
--- incubator/whirr/trunk/services/zookeeper/src/main/resources/functions/install_zookeeper.sh (original)
+++ incubator/whirr/trunk/services/zookeeper/src/main/resources/functions/install_zookeeper.sh Thu May 5 08:35:11 2011
@@ -44,11 +44,11 @@ function install_zookeeper() {
CRON="0 0 * * * java -cp $ZK_JAR:$ZK_LOG4J_JAR:$ZK_CONF_DIR org.apache.zookeeper.server.PurgeTxnLog $ZK_DATA_DIR $ZK_DATA_DIR -n 10"
crontab -l 2>/dev/null | { cat; echo "$CRON"; } | sort | uniq | crontab -
-
- # Ensure ZooKeeper starts on boot
- sed -i -e "s/exit 0//" /etc/rc.local
-cat >> /etc/rc.local <<EOF
-ZOOCFGDIR=$ZK_CONF_DIR $ZOOKEEPER_HOME/bin/zkServer.sh start > /dev/null 2>&1 &
-EOF
+ cat >/etc/init.d/zookeeper <<EOF
+#!/bin/bash
+ZOOCFGDIR=$ZK_CONF_DIR $ZOOKEEPER_HOME/bin/zkServer.sh \$@ > /dev/null 2>&1 &
+EOF
+ chmod +x /etc/init.d/zookeeper
+ install_service zookeeper
}
Added: incubator/whirr/trunk/services/zookeeper/src/main/resources/functions/start_zookeeper.sh
URL: http://svn.apache.org/viewvc/incubator/whirr/trunk/services/zookeeper/src/main/resources/functions/start_zookeeper.sh?rev=1099716&view=auto
==============================================================================
--- incubator/whirr/trunk/services/zookeeper/src/main/resources/functions/start_zookeeper.sh (added)
+++ incubator/whirr/trunk/services/zookeeper/src/main/resources/functions/start_zookeeper.sh Thu May 5 08:35:11 2011
@@ -0,0 +1,19 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+function start_zookeeper() {
+ /etc/init.d/zookeeper start
+}
Added: incubator/whirr/trunk/services/zookeeper/src/main/resources/functions/stop_zookeeper.sh
URL: http://svn.apache.org/viewvc/incubator/whirr/trunk/services/zookeeper/src/main/resources/functions/stop_zookeeper.sh?rev=1099716&view=auto
==============================================================================
--- incubator/whirr/trunk/services/zookeeper/src/main/resources/functions/stop_zookeeper.sh (added)
+++ incubator/whirr/trunk/services/zookeeper/src/main/resources/functions/stop_zookeeper.sh Thu May 5 08:35:11 2011
@@ -0,0 +1,19 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+function stop_zookeeper() {
+ /etc/init.d/zookeeper stop
+}