The configuration key hive.server2.transport.mode in kubernetes/conf/hive-site.xml specifies the transport mode of the HiveServer2 Thrift service.

  • binary for the default mode using Thrift RPC
  • http for the HTTP mode which sends Thrift RPC messages over HTTP transport
  • all for enabling both modes (with HIVE-5312)

The following environment variables in kubernetes/env.sh specify Thrift port numbers.

HIVE_SERVER2_PORT=9852        # for binary
HIVE_SERVER2_HTTP_PORT=10001  # for http

Note that if hive.server2.transport.mode is set to all, both port numbers should be specified because HiveServer2 runs two Thrift services concurrently.

For Helm, the fields hive/port and hive/httpport in kubernetes/helm/hive/values.yaml specify Thrift port numbers.

hive:
  port: 9852        # for binary
  httpport: 10001   # for http

The liveness and readiness probes of HiveServer2 performs TPC checks on the port for the default mode.

        readinessProbe:
          tcpSocket:
            port: 9852
        livenessProbe:
          tcpSocket:
            port: 9852

The user can use HTTP checks if hive.server2.transport.mode is set to http or all, but only if SSL is disabled.

        readinessProbe:
          httpGet:
            path: /cliservice
            port: 10001
        livenessProbe:
          httpGet:
            path: /cliservice
            port: 10001

The user can check the log of HiveServer2 to see if HiveServer2 Thrift services start properly.

2020-10-01T03:19:24,129  INFO [main] thrift.ThriftCLIService: Started ThriftHttpCLIService in https mode on port 10001 path=/cliservice/* with 5...500 worker threads
...
2020-10-01T03:19:24,253  INFO [main] thrift.ThriftCLIService: Starting ThriftBinaryCLIService on port 9852 with 5...500 worker threads