deb-sahara/sahara/plugins/storm/run_scripts.py
Telles Nobrega 7dc31d33a4 Storm integration
This patch implements the Storm plugin.

Implements: bp storm-integration
Change-Id: I65e76b7c4d63e2fd0c4a52ec2a198a7510ccbaad
2014-12-04 08:30:33 -03:00

60 lines
1.7 KiB
Python

# Copyright (c) 2014 Hoang Do, Phuc Vo, P. Michiardi, D. Venzano
#
# Licensed 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.
from sahara.openstack.common import log as logging
LOG = logging.getLogger(__name__)
def start_zookeeper(remote):
remote.execute_command("sudo %s %s" % (
"/opt/zookeeper/zookeeper-3.4.6/bin/zkServer.sh",
"start"))
def start_storm_supervisor(node):
_create_supervisor_log_file(node)
_stop_supervisor_deamon(node)
_start_supervisor_deamon(node)
def start_storm_nimbus_and_ui(node):
_create_supervisor_log_file(node)
_stop_supervisor_deamon(node)
_start_supervisor_deamon(node)
def stop_storm_nimbus_and_ui(node):
_stop_supervisor_deamon(node)
def stop_storm_supervisor(node):
_stop_supervisor_deamon(node)
def _start_supervisor_deamon(node):
node.execute_command("sudo service supervisor start")
def _stop_supervisor_deamon(node):
node.execute_command("sudo service supervisor stop")
def _create_supervisor_log_file(node):
node.execute_command("sudo mkdir -p /var/log/storm")
node.execute_command("sudo chmod -R 777 /var/log/storm")
node.execute_command("sudo chown -R storm:storm /var/log/storm")