Fix wrong hue-livy process name and move installation

Hue livy was not starting when installing in 'install' step,
because it has invalid process name 'hue-livy', so it was
installing in 'post-start' step. Changed name to 'livy' and
move installation to 'install' step.

Change-Id: I4d4968fa8ee03a840688ac6fb98f9a17d30ada65
Closes-Bug: #1612671
This commit is contained in:
Grigoriy Roghkov 2016-08-10 16:24:41 +03:00 committed by Grigoriy Rozhkov
parent 0b8971471f
commit deda629d60

View File

@ -50,7 +50,7 @@ HUE = np.NodeProcess(
)
HUE_LIVY = np.NodeProcess(
name="hue-livy",
name="livy",
ui_name="Hue Livy",
package="mapr-hue-livy",
open_ports=[8998]
@ -122,13 +122,6 @@ class Hue(s.Service):
return [hue_ini, hue_sh]
def _get_packages(self, cluster_context, node_processes):
result = []
result += self.dependencies
result += [(np.package, self.version) for np in [HUE]]
return result
def _get_hue_ini_props(self, context):
db_instance = mysql.MySQL.get_db_instance(context)
is_yarn = context.cluster_mode == 'yarn'
@ -186,8 +179,7 @@ class Hue(s.Service):
hue_instance = cluster_context.get_instance(HUE)
def migrate_database(remote, context):
hue_service = context.get_service(HUE)
hue_home = '/opt/mapr/hue/hue-%s' % hue_service.version
hue_home = self.home_dir(cluster_context)
cmd = '%(activate)s && %(syncdb)s && %(migrate)s'
args = {
'activate': 'source %s/build/env/bin/activate' % hue_home,
@ -237,7 +229,6 @@ class Hue(s.Service):
self.restart([hue_instance])
def post_start(self, cluster_context, instances):
self._install_livy(cluster_context, instances=instances)
self.update(cluster_context, instances=instances)
def restart(self, instances):
@ -247,18 +238,6 @@ class Hue(s.Service):
if filtered_instances:
node_process.restart(filtered_instances)
# need to be installed after cldb start
def _install_livy(self, cluster_context, instances):
hue_livy_instance = cluster_context.get_instance(HUE_LIVY)
spark_instance = cluster_context.get_instance(
spark.SPARK_HISTORY_SERVER)
if hue_livy_instance and spark_instance:
with hue_livy_instance.remote() as r:
cmd = cluster_context.distro.create_install_cmd(
[(HUE_LIVY.package, self.version)])
r.execute_command(cmd, run_as_root=True,
timeout=s._INSTALL_PACKAGES_TIMEOUT)
def _should_restart(self, c_context, instances):
app_services = [
impala.Impala(),