#NEWLINE# @ staticmethod #NEWLINE# def _handle_pre_service_start( instance , cluster_spec , hue_ini , create_user ) : #NEWLINE# #INDENT# with instance . remote ( ) as r : #NEWLINE# #INDENT# r . execute_command ( 'yum -y install hue' , run_as_root = True ) #NEWLINE# LOG . info ( _LI ( 'Installed Hue' ) ) #NEWLINE# r . write_file_to ( '/etc/hue/conf/hue.ini' , hue_ini , True ) #NEWLINE# r . execute_command ( '[ ! -f /tmp/hueini-hdfsha ] || sed -i "s/hdfs.*.:8020/hdfs:\\/\\/`cat /tmp/hueini-hdfsha`/g" /etc/hue/conf/hue.ini' , run_as_root = True ) #NEWLINE# r . execute_command ( '[ ! -f /tmp/hueini-hdfsha ] || sed -i "s/http.*.\\/webhdfs\\/v1\\//http:\\/\\/localhost:14000\\/webhdfs\\/v1\\//g" /etc/hue/conf/hue.ini' , run_as_root = True ) #NEWLINE# LOG . info ( _LI ( 'Setting Hue configuration' ) ) #NEWLINE# r . execute_command ( '/usr/lib/hue/build/env/bin/python /usr/lib/hue/tools/app_reg/app_reg.py --remove shell' , run_as_root = True ) #NEWLINE# LOG . info ( _LI ( 'Shell uninstalled, if it was installed' ) ) #NEWLINE# if create_user : #NEWLINE# #INDENT# r . execute_command ( '/usr/lib/hue/build/env/bin/hue create_sandbox_user' , run_as_root = True ) #NEWLINE# LOG . info ( _LI ( 'Initial Hue user created' ) ) #NEWLINE# #UNINDENT# java_home = HueService . _get_java_home ( cluster_spec ) #NEWLINE# if java_home : #NEWLINE# #INDENT# r . replace_remote_string ( '/etc/hadoop/conf/hadoop-env.sh' , 'export JAVA_HOME=.*' , ( 'export JAVA_HOME=%s' % java_home ) ) #NEWLINE# #UNINDENT# r . execute_command ( 'service hue start' , run_as_root = True ) #NEWLINE# r . execute_command ( '[ ! -f /tmp/hueini-hdfsha ] || service hadoop-httpfs start' , run_as_root = True ) #NEWLINE# LOG . info ( _LI ( 'Hue (re)started' ) )