env = os.environ.copy() env['HBASE_CONF_DIR'] = os.path.join(self.data_dir, 'config') env['JAVA_HOME'] = self.java_home return env def call(self, cmd, env=None): p = subprocess.Popen(cmd, env=env) ret_code = p.wait() if (ret_code != 0): raise RuntimeError("command failed with {0} at {1}: {2}".format( ret_code, es.gethostname(), ' '.join(cmd))) data = json.load(sys.stdin) if len(sys.argv) > 2: cmd = sys.argv[2] elif len(sys.argv) > 1: cmd = sys.argv[1] else: cmd = 'start' server = HBaseServer(data, host=sys.argv[1], sys_dirs=es.SysDirs()) if (cmd == 'stop'): server.stop() elif (cmd == 'install'): server.install() else: server.start()
def env(self): env = os.environ.copy() env['JVM_FLAGS'] = self.param.get('jvm_opt', '-server') env.update(self.param.get('env', {})) return env def stop(self): subprocess.call("kill -9 $(jps | grep 'TSOServer' | awk '{print $1}')", shell=True) data = json.load(sys.stdin) if len(sys.argv) > 2: cmd = sys.argv[2] elif len(sys.argv) > 1: cmd = sys.argv[1] else: cmd = 'start' sd = es.SysDirs() server = OmidServer(data, host=sys.argv[1], script_home=sd.script_home) if (cmd == 'stop'): server.stop() elif (cmd == 'install'): server.install() else: server.start()
env = os.environ.copy() opts = "-server " port = self.port() if (port > 0): opts += "-Dworker.port={0} ".format(port) jmxport = self.jmxport() if (jmxport > 0): opts += "-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port={0} ".format(jmxport) opts += "-Dstrudel.classpath.base={0} ".format(self.lib_dir) env['STRUDEL_WKLD_OPTS'] = opts + self.param.get('jvm_opt','-Xmx1G') return env if len(sys.argv) > 2: cmd = sys.argv[2] else: cmd = 'restart' data = json.load(sys.stdin) sys_dirs = es.SysDirs() server = WorkerServer(data, sys_dirs.home, os.path.join(sys_dirs.home, 'strudel', 'bin')); server.stop() if (cmd == 'restart'): server.start()