Пример #1
0
  def service_check(self, env):
    import params
    env.set_params(params)

    address_list = params.hive_server_hosts
    port = int(format("{hive_server_port}"))
    print "Test connectivity to hive server"
    if params.security_enabled:
      kinitcmd=format("{kinit_path_local} -kt {smoke_user_keytab} {smokeuser_principal}; ")
    else:
      kinitcmd=None

    workable_server_available = False
    for address in address_list:
      try:
        check_thrift_port_sasl(address, port, params.hive_server2_authentication,
                               params.hive_server_principal, kinitcmd, params.smokeuser,
                               transport_mode=params.hive_transport_mode)
        print "Successfully connected to %s on port %s" % (address, port)
        workable_server_available = True
      except:
        print "Connection to %s on port %s failed" % (address, port)

    if not workable_server_available:
      exit(1)

    hcat_service_check()
    webhcat_service_check()
Пример #2
0
  def service_check(self, env):
    import params
    env.set_params(params)
    smoke_cmd = os.path.join(params.hdp_root,"Run-SmokeTests.cmd")
    service = "HIVE"
    Execute(format("cmd /C {smoke_cmd} {service}"), user=params.hive_user, logoutput=True)

    webhcat_service_check()
Пример #3
0
  def service_check(self, env):
    import params
    env.set_params(params)
    smoke_cmd = os.path.join(params.stack_root,"Run-SmokeTests.cmd")
    service = "HIVE"
    Execute(format("cmd /C {smoke_cmd} {service}"), user=params.hive_user, logoutput=True)

    hcat_service_check()
    webhcat_service_check()
Пример #4
0
  def service_check(self, env):
    import params
    env.set_params(params)

    address_list = params.hive_server_hosts

    if not address_list:
      raise Fail("Can not find any Hive Server host. Please check configuration.")

    port = int(format("{hive_server_port}"))
    print "Test connectivity to hive server"
    if params.security_enabled:
      kinitcmd=format("{kinit_path_local} -kt {smoke_user_keytab} {smokeuser_principal}; ")
    else:
      kinitcmd=None

    SOCKET_WAIT_SECONDS = 290

    start_time = time.time()
    end_time = start_time + SOCKET_WAIT_SECONDS

    print "Waiting for the Hive server to start..."
      
    workable_server_available = False
    i = 0
    while time.time() < end_time and not workable_server_available:
      address = address_list[i]
      try:
        check_thrift_port_sasl(address, port, params.hive_server2_authentication,
                               params.hive_server_principal, kinitcmd, params.smokeuser,
                               transport_mode=params.hive_transport_mode, http_endpoint=params.hive_http_endpoint,
                               ssl=params.hive_ssl, ssl_keystore=params.hive_ssl_keystore_path,
                               ssl_password=params.hive_ssl_keystore_password)
        print "Successfully connected to %s on port %s" % (address, port)
        workable_server_available = True
      except:
        print "Connection to %s on port %s failed" % (address, port)
        time.sleep(5)
        
      i += 1
      if i == len(address_list):
        i = 0
          
    elapsed_time = time.time() - start_time
    
    if not workable_server_available:
      raise Fail("Connection to Hive server %s on port %s failed after %d seconds" %
                 (params.hostname, params.hive_server_port, elapsed_time))
    
    print "Successfully connected to Hive at %s on port %s after %d seconds" %\
          (params.hostname, params.hive_server_port, elapsed_time)

    hcat_service_check()
    webhcat_service_check()
Пример #5
0
    def service_check(self, env):
        import params
        env.set_params(params)

        address = format("{hive_server_host}")
        port = int(format("{hive_server_port}"))
        print "Test connectivity to hive server"
        if check_thrift_port_sasl(address, port):
            print "Successfully connected to %s on port %s" % (address, port)
        else:
            print "Connection to %s on port %s failed: %s" % (address, port)

        hcat_service_check()
        webhcat_service_check()
Пример #6
0
  def service_check(self, env):
    import params
    env.set_params(params)

    address=format("{hive_server_host}")
    port=int(format("{hive_server_port}"))
    print "Test connectivity to hive server"
    if check_thrift_port_sasl(address, port, security_enabled=params.security_enabled):
      print "Successfully connected to %s on port %s" % (address, port)
    else:
      print "Connection to %s on port %s failed" % (address, port)
      exit(1)

    hcat_service_check()
    webhcat_service_check()
Пример #7
0
    def service_check(self, env):
        import params
        env.set_params(params)

        if params.security_enabled:
            kinit_cmd = format(
                "{kinit_path_local} -kt {smoke_user_keytab} {smokeuser_principal}; "
            )
        else:
            kinit_cmd = ""

        # Check HiveServer
        Logger.info("Running Hive Server checks")
        Logger.info("--------------------------\n")
        self.check_hive_server(env, 'Hive Server', kinit_cmd,
                               params.hive_server_hosts,
                               int(format("{hive_server_port}")),
                               params.hive_ssl_keystore_path,
                               params.hive_ssl_keystore_password)

        if params.has_hive_interactive and params.hive_interactive_enabled:
            Logger.info("Running Hive Server2 checks")
            Logger.info("--------------------------\n")

            self.check_hive_server(
                env, 'Hive Server2', kinit_cmd, params.hive_interactive_hosts,
                int(format("{hive_server_interactive_port}")),
                params.hive_interactive_ssl_keystore_path,
                params.hive_interactive_ssl_keystore_password)

            Logger.info("Running LLAP checks")
            Logger.info("-------------------\n")
            self.check_llap(env, kinit_cmd, params.hive_interactive_hosts,
                            int(format("{hive_server_interactive_port}")),
                            params.hive_llap_principal,
                            params.hive_server2_authentication,
                            params.hive_transport_mode,
                            params.hive_http_endpoint)

        Logger.info("Running HCAT checks")
        Logger.info("-------------------\n")
        hcat_service_check()

        Logger.info("Running WEBHCAT checks")
        Logger.info("---------------------\n")
        webhcat_service_check()
Пример #8
0
  def service_check(self, env):
    import params
    env.set_params(params)

    address=format("{hive_server_host}")
    port=int(format("{hive_server_port}"))
    print "Test connectivity to hive server"

    if params.security_enabled:
      kinitcmd=format("{kinit_path_local} -kt {smoke_user_keytab} {smokeuser}; ")
    else:
      kinitcmd=None

    try:
      check_thrift_port_sasl(address, port, params.hive_server2_authentication,
                             params.hive_server_principal, kinitcmd)
      print "Successfully connected to %s on port %s" % (address, port)
    except:
      print "Connection to %s on port %s failed" % (address, port)
      exit(1)

    hcat_service_check()
    webhcat_service_check()
Пример #9
0
class HiveServiceCheck(Script):
  def service_check(self, env):
    import params
    env.set_params(params)

    address=format("{hive_server_host}")
    port=int(format("{hive_server_port}"))
    s = socket.socket()
    print "Test connectivity to hive server"
    try:
      s.connect((address, port))
      print "Successfully connected to %s on port %s" % (address, port)
      s.close()
    except socket.error, e:
      print "Connection to %s on port %s failed: %s" % (address, port, e)
      sys.exit(1)

    hcat_service_check()
    webhcat_service_check()
Пример #10
0
    def service_check(self, env):
        import params
        env.set_params(params)

        address_list = params.hive_server_hosts

        if not address_list:
            raise Fail(
                "Can not find any Hive Server host. Please check configuration."
            )

        port = int(format("{hive_server_port}"))
        print "Test connectivity to hive server"
        if params.security_enabled:
            kinitcmd = format(
                "{kinit_path_local} -kt {smoke_user_keytab} {smokeuser_principal}; "
            )
        else:
            kinitcmd = None

        SOCKET_WAIT_SECONDS = 290

        start_time = time.time()
        end_time = start_time + SOCKET_WAIT_SECONDS

        print "Waiting for the Hive server to start..."

        workable_server_available = False
        i = 0
        while time.time() < end_time and not workable_server_available:
            address = address_list[i]
            try:
                check_thrift_port_sasl(
                    address,
                    port,
                    params.hive_server2_authentication,
                    params.hive_server_principal,
                    kinitcmd,
                    params.smokeuser,
                    transport_mode=params.hive_transport_mode,
                    http_endpoint=params.hive_http_endpoint,
                    ssl=params.hive_ssl,
                    ssl_keystore=params.hive_ssl_keystore_path,
                    ssl_password=params.hive_ssl_keystore_password)
                print "Successfully connected to %s on port %s" % (address,
                                                                   port)
                workable_server_available = True
            except:
                print "Connection to %s on port %s failed" % (address, port)
                time.sleep(5)

            i += 1
            if i == len(address_list):
                i = 0

        elapsed_time = time.time() - start_time

        if not workable_server_available:
            raise Fail(
                "Connection to Hive server %s on port %s failed after %d seconds"
                % (params.hostname, params.hive_server_port, elapsed_time))

        print "Successfully connected to Hive at %s on port %s after %d seconds" %\
              (params.hostname, params.hive_server_port, elapsed_time)

        hcat_service_check()
        webhcat_service_check()