示例#1
0
 def stop(self):
     spark_home = self.dist_config.path('spark')
     # Only stop services if they're running
     if utils.jps("HistoryServer"):
         utils.run_as('ubuntu', '{}/sbin/stop-history-server.sh'.format(spark_home))
     if utils.jps("Master"):
         utils.run_as('ubuntu', '{}/sbin/stop-master.sh'.format(spark_home))
     if utils.jps("Worker"):
         utils.run_as('ubuntu', '{}/sbin/stop-slave.sh'.format(spark_home))
def stop_datagrid_services():
    if utils.jps("insightedge.marker=master"):
        d = dict(os.environ)
        d["TIMEOUT"] = str(10)
        cmd = "/usr/lib/insightedge/sbin/stop-datagrid-master.sh"
        subprocess.call(cmd, shell=True, env=d)
    if utils.jps("insightedge.marker=slave"):
        cmd = "/usr/lib/insightedge/sbin/stop-datagrid-slave.sh"
        subprocess.call(cmd, shell=False)
def stop_datagrid_services():
    dc = get_dist_config()
    ie_home = dc.path('spark')
    if utils.jps("insightedge.marker=master"):
        d = dict(os.environ)
        d["TIMEOUT"] = str(10)
        subprocess.call([ie_home / "sbin" / "stop-datagrid-master.sh"], env=d)
    if utils.jps("insightedge.marker=slave"):
        subprocess.call([ie_home / "sbin" / "stop-datagrid-slave.sh"])
示例#4
0
 def stop(self):
     if not unitdata.kv().get('spark.installed', False):
         return
     # Only stop services if they're running
     if utils.jps("HistoryServer"):
         host.service_stop('spark-history-server')
     if utils.jps("Master"):
         host.service_stop('spark-master')
     if utils.jps("Worker"):
         host.service_stop('spark-worker')
示例#5
0
 def stop(self):
     spark_home = self.dist_config.path('spark')
     # Only stop services if they're running
     if utils.jps("HistoryServer"):
         utils.run_as('ubuntu',
                      '{}/sbin/stop-history-server.sh'.format(spark_home))
     if utils.jps("Master"):
         utils.run_as('ubuntu', '{}/sbin/stop-master.sh'.format(spark_home))
     if utils.jps("Worker"):
         utils.run_as('ubuntu', '{}/sbin/stop-slave.sh'.format(spark_home))
 def stop(self):
     if not unitdata.kv().get('spark.installed', False):
         return
     # Only stop services if they're running
     if utils.jps("HistoryServer"):
         host.service_stop('spark-history')
     if utils.jps("Master"):
         host.service_stop('spark-master')
     if utils.jps("Worker"):
         host.service_stop('spark-slave')
 def stop(self):
     if not unitdata.kv().get('spark.installed', False):
         return
     spark_home = self.dist_config.path('spark')
     # Only stop services if they're running
     if utils.jps("HistoryServer"):
         utils.run_as('ubuntu', '{}/sbin/stop-history-server.sh'.format(spark_home))
     if utils.jps("Master"):
         utils.run_as('ubuntu', '{}/sbin/stop-master.sh'.format(spark_home))
     if utils.jps("Worker"):
         utils.run_as('ubuntu', '{}/sbin/stop-slave.sh'.format(spark_home))
示例#8
0
 def stop(self):
     if not unitdata.kv().get('spark.installed', False):
         return
     spark_home = self.dist_config.path('spark')
     # Only stop services if they're running
     if utils.jps("HistoryServer"):
         utils.run_as('ubuntu',
                      '{}/sbin/stop-history-server.sh'.format(spark_home))
     if utils.jps("Master"):
         utils.run_as('ubuntu', '{}/sbin/stop-master.sh'.format(spark_home))
     if utils.jps("Worker"):
         utils.run_as('ubuntu', '{}/sbin/stop-slave.sh'.format(spark_home))
示例#9
0
 def stop(self):
     if utils.jps("zeppelin"):
         host.service_stop('zeppelin')
         # wait for the process to stop, since issuing a start while the
         # process is still running (i.e., restart) could cause it to not
         # start up again
         self.wait_for_stop(30)
示例#10
0
 def start(self):
     # Start if we're not already running. We currently dont have any
     # runtime config options, so no need to restart when hooks fire.
     if not utils.jps("zeppelin"):
         host.service_start('zeppelin')
         # wait up to 30s for server to start responding, lest API requests fail
         self.wait_for_api(30)
示例#11
0
 def register_slaves(self, slaves=None):
     if not slaves:  # FIXME hack-around until transition to layers is complete
         slaves = helpers.all_ready_units('datanode')
         slaves = [data['hostname'] for slave, data in slaves]
     self.hadoop_base.register_slaves(slaves)
     if utils.jps('NameNode'):
         self.hadoop_base.run('hdfs', 'bin/hdfs', 'dfsadmin', '-refreshNodes')
示例#12
0
 def register_slaves(self, slaves=None):
     if not slaves:  # FIXME hack-around until transition to layers is complete
         slaves = helpers.all_ready_units('nodemanager')
         slaves = [data['hostname'] for slave, data in slaves]
     self.hadoop_base.register_slaves(slaves)
     if utils.jps('ResourceManager'):
         self.hadoop_base.run('mapred', 'bin/yarn', 'rmadmin', '-refreshNodes')
示例#13
0
 def start_secondarynamenode(self):
     if not utils.jps('SecondaryNameNode'):
         self._hadoop_daemon('start', 'secondarynamenode')
         # Some hadoop processes take a bit of time to start
         # we need to let them get to a point where they are
         # ready to accept connections - increase the value for hadoop 2.4.1
         time.sleep(30)
 def start(self):
     # Start if we're not already running. We currently dont have any
     # runtime config options, so no need to restart when hooks fire.
     if not utils.jps("livy"):
         livy_log = self.dist_config.path("livy_logs") + "livy-server.log"
         livy_home = self.dist_config.path("livy")
         # chdir here because things like zepp tutorial think ZEPPELIN_HOME
         # is wherever the daemon was started from.
         os.chdir(livy_home)
         utils.run_as("hue", "./bin/livy-server", "2>&1", livy_log, "&")
示例#15
0
 def start(self):
     if not utils.jps("Main"):
         livy_log = self.dist_config.path('livy_logs') / 'livy-server.log'
         livy_home = self.dist_config.path('livy')
         # chdir here because things like zepp tutorial think ZEPPELIN_HOME
         # is wherever the daemon was started from.
         os.chdir(livy_home)
         #utils.run_as(self.user, './bin/livy-server', '2>&1', livy_log, '&')
         #utils.run_as(self.user, './bin/livy-server', '&')
         os.system("su {} -c \"./bin/livy-server 2>&1 > {} &\"".format(self.user, livy_log))
示例#16
0
 def start(self):
     # Start if we're not already running. We currently dont have any
     # runtime config options, so no need to restart when hooks fire.
     if not utils.jps("zeppelin"):
         zeppelin_conf = self.dist_config.path('zeppelin_conf')
         zeppelin_home = self.dist_config.path('zeppelin')
         # chdir here because things like zepp tutorial think ZEPPELIN_HOME
         # is wherever the daemon was started from.
         os.chdir(zeppelin_home)
         utils.run_as('ubuntu', '{}/bin/zeppelin-daemon.sh'.format(zeppelin_home), '--config', zeppelin_conf, 'start')
示例#17
0
 def start(self):
     if not utils.jps("Main"):
         livy_log = self.dist_config.path('livy_logs') / 'livy-server.log'
         livy_home = self.dist_config.path('livy')
         # chdir here because things like zepp tutorial think ZEPPELIN_HOME
         # is wherever the daemon was started from.
         os.chdir(livy_home)
         #utils.run_as(self.user, './bin/livy-server', '2>&1', livy_log, '&')
         #utils.run_as(self.user, './bin/livy-server', '&')
         os.system("su {} -c \"./bin/livy-server 2>&1 > {} &\"".format(
             self.user, livy_log))
示例#18
0
 def start(self):
     # Start if we're not already running. We currently dont have any
     # runtime config options, so no need to restart when hooks fire.
     if not utils.jps("zeppelin"):
         zeppelin_conf = self.dist_config.path('zeppelin_conf')
         zeppelin_home = self.dist_config.path('zeppelin')
         # chdir here because things like zepp tutorial think ZEPPELIN_HOME
         # is wherever the daemon was started from.
         os.chdir(zeppelin_home)
         utils.run_as('ubuntu',
                      '{}/bin/zeppelin-daemon.sh'.format(zeppelin_home),
                      '--config', zeppelin_conf, 'start')
示例#19
0
 def start(self):
     """
     Override start to use InsightEdge's wrapper.
     """
     # Start if we're not already running. We currently dont have any
     # runtime config options, so no need to restart when hooks fire.
     if not utils.jps("zeppelin"):
         ie_home = self.dist_config.path('insightedge')
         zeppelin_home = self.dist_config.path('zeppelin')
         # chdir here because things like zepp tutorial think ZEPPELIN_HOME
         # is wherever the daemon was started from.
         with host.chdir(zeppelin_home):
             utils.run_as('ubuntu',
                          '{}/sbin/start-zeppelin.sh'.format(ie_home))
         # wait up to 30s for API to start, lest requests fail
         self.wait_for_api(30)
示例#20
0
 def stop(self):
     """
     Override start to use InsightEdge's wrapper.
     """
     # Start if we're not already running. We currently dont have any
     # runtime config options, so no need to restart when hooks fire.
     if not utils.jps("zeppelin"):
         ie_home = self.dist_config.path('insightedge')
         zeppelin_home = self.dist_config.path('zeppelin')
         # chdir here because things like zepp tutorial think ZEPPELIN_HOME
         # is wherever the daemon was started from.
         with host.chdir(zeppelin_home):
             utils.run_as('ubuntu',
                          '{}/sbin/stop-zeppelin.sh'.format(ie_home))
         # wait for the process to stop, since issuing a start while the
         # process is still running (i.e., restart) could cause it to not
         # start up again
         self.wait_for_stop(30)
示例#21
0
 def start_nodemanager(self):
     if not utils.jps('NodeManager'):
         host.service_start('nodemanager')
示例#22
0
 def start_journalnode(self):
     if not utils.jps('JournalNode'):
         self._hadoop_daemon('start', 'journalnode')
 def stop(self):
     flume_path = self.dist_config.path('flume')
     flume_pids = utils.jps(r'-cp .*{}'.format(flume_path))
     for pid in flume_pids:
         os.kill(int(pid), signal.SIGKILL)
示例#24
0
 def start_journalnode(self):
     if not utils.jps('JournalNode'):
         host.service_start('journalnode')
示例#25
0
 def reload_slaves(self):
     if utils.jps('NameNode'):
         self.hadoop_base.run('hdfs', 'bin/hdfs', 'dfsadmin', '-refreshNodes')
 def stop(self):
     if utils.jps("zeppelin"):
         zeppelin_conf = self.dist_config.path('zeppelin_conf')
         zeppelin_home = self.dist_config.path('zeppelin')
         daemon = '{}/bin/zeppelin-daemon.sh'.format(zeppelin_home)
         utils.run_as('ubuntu', daemon, '--config', zeppelin_conf, 'stop')
示例#27
0
 def start_nodemanager(self):
     if not utils.jps('NodeManager'):
         self._yarn_daemon('start', 'nodemanager')
示例#28
0
 def start_resourcemanager(self):
     if not utils.jps('ResourceManager'):
         self._yarn_daemon('start', 'resourcemanager')
示例#29
0
 def start_datanode(self):
     if not utils.jps('DataNode'):
         host.service_start('datanode')
示例#30
0
 def start_secondarynamenode(self):
     if not utils.jps('SecondaryNameNode'):
         host.service_start('secondarynamenode')
示例#31
0
 def start_namenode(self):
     if not utils.jps('NameNode'):
         host.service_start('namenode')
示例#32
0
 def start_namenode(self):
     if not utils.jps('NameNode'):
         host.service_start('namenode')
示例#33
0
 def register_slaves(self, slaves):
     self.hadoop_base.register_slaves(slaves)
     if utils.jps('ResourceManager'):
         self.hadoop_base.run('mapred', 'bin/yarn', 'rmadmin', '-refreshNodes')
示例#34
0
 def stop(self):
     flume_pids = utils.jps(r'-cp .*{}'.format(
         self.dist_config.path('flume')))
     for pid in flume_pids:
         os.kill(int(pid), signal.SIGKILL)
示例#35
0
 def start_jobhistory(self):
     if not utils.jps('JobHistoryServer'):
         host.service_start('historyserver')
示例#36
0
 def start_resourcemanager(self):
     if not utils.jps('ResourceManager'):
         host.service_start('resourcemanager')
示例#37
0
 def start_nodemanager(self):
     if not utils.jps('NodeManager'):
         host.service_start('nodemanager')
示例#38
0
 def wait_for_stop(self, timeout):
     start = time.time()
     while utils.jps("zeppelin"):
         time.sleep(1)
         if time.time() - start > timeout:
             raise utils.TimeoutError('Zeppelin did not stop')
示例#39
0
 def start_datanode(self):
     if not utils.jps('DataNode'):
         self._hadoop_daemon('start', 'datanode')
示例#40
0
 def start(self):
     spark_home = self.dist_config.path('spark')
     if utils.jps("HistoryServer"):
         self.stop()
     utils.run_as('ubuntu', '{}/sbin/start-history-server.sh'.format(spark_home), 'hdfs:///user/ubuntu/directory')
示例#41
0
 def start_datanode(self):
     if not utils.jps('DataNode'):
         host.service_start('datanode')
 def restart(self, user='******'):
     # check for a java process with our flume dir in the classpath
     if utils.jps(r'-cp .*{}'.format(self.dist_config.path('flume'))):
         self.stop()
     self.start(user)
示例#43
0
 def stop(self):
     kafka_pids = utils.jps('kafka.Kafka')
     for pid in kafka_pids:
         os.kill(int(pid), signal.SIGKILL)
示例#44
0
 def stop(self):
     hive_pids = utils.jps('HiveServer2')
     for pid in hive_pids:
         os.kill(int(pid), signal.SIGTERM)
示例#45
0
 def stop(self):
     hive_pids = utils.jps('HiveServer2')
     for pid in hive_pids:
         os.kill(int(pid), signal.SIGTERM)
示例#46
0
 def register_slaves(self, slaves):
     self.hadoop_base.register_slaves(slaves)
     if utils.jps('ResourceManager'):
         self.hadoop_base.run('mapred', 'bin/yarn', 'rmadmin',
                              '-refreshNodes')
示例#47
0
 def start_jobhistory(self):
     if not utils.jps('JobHistoryServer'):
         host.service_start('historyserver')
示例#48
0
 def start_journalnode(self):
     if not utils.jps('JournalNode'):
         host.service_start('journalnode')
示例#49
0
 def start_secondarynamenode(self):
     if not utils.jps('SecondaryNameNode'):
         host.service_start('secondarynamenode')
示例#50
0
 def start_jobhistory(self):
     if not utils.jps('JobHistoryServer'):
         self._jobhistory_daemon('start', 'historyserver')
示例#51
0
 def reload_slaves(self):
     if utils.jps('NameNode'):
         self.hadoop_base.run('hdfs', 'bin/hdfs', 'dfsadmin',
                              '-refreshNodes')
示例#52
0
 def start_resourcemanager(self):
     if not utils.jps('ResourceManager'):
         host.service_start('resourcemanager')
示例#53
0
 def restart(self):
     # check for a java process with our flume dir in the classpath
     if utils.jps(r'-cp .*{}'.format(self.dist_config.path('flume'))):
         self.stop()
     self.start()