testbook

HiveServer2设置

配置

hive-site.xml文件中的配置属性

  • hive.server2.thrift.min.worker.threads
    默认值:5
    最小工作线程数
  • hive.server2.thrift.max.worker.threads
    默认值:500
    最大工作线程数
  • hive.server2.thrift.port
    监听的TCP端口号,默认值为10000.
  • hive.server2.thrift.bind.host
    绑定的TCP接口.

hive-site.xml文件中其他的配置属性

  • hive.server2.thrift.worker.keepalive.time
    默认值:60
    不工作的线程保持活跃的时间(单位为秒)。当线程数大于最小所需线程数,多余的线程会在这段时间后终止运行。
  • hive.server2.authentication
    默认值:NONE
    客户端的认证方式。有如下几种:
    • NONE:不认证,简单的SASL传输
    • LDAP:基于LDAP/AP的认证
    • KERBEROS:Kerberos/GSSAPI认证
    • CUSTOM:自定义认证方式(和 hive.server2.custom.authentication.class合用)
    • PAM
    • NOSASL
    • hive.server2.authentication.kerberos.keytab
      默认值:(空)

    • 默认值:

    • 默认值:
    • hive.server2.authentication.kerberos.keytab Default Value: (empty) Added In: Hive 0.11.0 with HIVE-2935 Kerberos keytab file for server principal. hive.server2.authentication.kerberos.principal Default Value: (empty) Added In: Hive 0.11.0 with HIVE-2935 Kerberos server principal. hive.server2.custom.authentication.class Default Value: (empty) Added In: Hive 0.11.0 with HIVE-2935 Custom authentication class. Used when property hive.server2.authentication is set to 'CUSTOM'. Provided class must be a proper implementation of the interface org.apache.hive.service.auth.PasswdAuthenticationProvider. HiveServer2 will call its Authenticate(user, passed) method to authenticate requests. The implementation may optionally extend Hadoop's org.apache.hadoop.conf.Configured class to grab Hive's Configuration object. hive.server2.enable.doAs Default Value: true Added In: Hive 0.11.0 with HIVE-2935 and HIVE-4356 Setting this property to true will have HiveServer2 execute Hive operations as the user making the calls to it. hive.server2.authentication.ldap.url Default Value: (empty) Added In: Hive 0.11.0 with HIVE-2935 LDAP connection URL(s), value could be a SPACE separated list of URLs to multiple LDAP servers for resiliency. URLs are tried in the order specified until the connection is successful. hive.server2.authentication.ldap.baseDN Default Value: (empty) Added In: Hive 0.11.0 with HIVE-2935 LDAP base DN (distinguished name). hive.server2.authentication.ldap.Domain Default Value: (empty) Added In: Hive 0.12.0 LDAP domain. hive.server2.global.init.file.location Default Value: $HIVE_CONF_DIR (typically /conf) Added in Hive 0.14.0 with HIVE-5160, HIVE-7497, and HIVE-8138 Either the location of a HiveServer2 global init file or a directory containing a .hiverc file. If the property is set, the value must be a valid path to an init file or directory where the init file is located. hive.server2.transport.mode Default Value: binary Added In: Hive 0.12.0 Server transport mode. Value can be "binary" or "http". hive.server2.thrift.http.port Default Value: 10001 Added In: Hive 0.12.0 Port number when in HTTP mode. hive.server2.thrift.http.path Default Value: cliservice Added In: Hive 0.12.0 Path component of URL endpoint when in HTTP mode. hive.server2.thrift.http.min.worker.threads Default Value: 5 Added In: Hive 0.12.0 Minimum number of worker threads when in HTTP mode. hive.server2.thrift.http.max.worker.threads Default Value: 500 Added In: Hive 0.12.0 Maximum number of worker threads when in HTTP mode. hive.server2.thrift.http.max.idle.time Default Value: 1800s (ie, 1800 seconds) Added In: Hive 0.14.0 in HIVE-7169 Maximum idle time for a connection on the server when in HTTP mode. hive.server2.thrift.http.worker.keepalive.time Default Value: 60 Added In: Hive 0.14.0 in HIVE-7353 Keepalive time (in seconds) for an idle http worker thread. When number of workers > min workers, excess threads are killed after this time interval. hive.server2.thrift.sasl.qop Default Value: auth Added In: Hive 0.12.0 Sasl QOP value; set it to one of the following values to enable higher levels of protection for HiveServer2 communication with clients. "auth" – authentication only (default) "auth-int" – authentication plus integrity protection "auth-conf" – authentication plus integrity and confidentiality protection Note that hadoop.rpc.protection being set to a higher level than HiveServer2 does not make sense in most situations. HiveServer2 ignores hadoop.rpc.protection in favor of hive.server2.thrift.sasl.qop. This is applicable only if HiveServer2 is configured to use Kerberos authentication. hive.server2.async.exec.threads Default Value: 50 in Hive 0.12.0, 100 in Hive 0.13.0 and later Added In: Hive 0.12.0 with HIVE-4617, default value changed in Hive 0.13.0 with HIVE-5229 Number of threads in the async thread pool for HiveServer2. hive.server2.async.exec.shutdown.timeout Default Value: 10 Added In: Hive 0.12.0 with HIVE-4617 Time (in seconds) for which HiveServer2 shutdown will wait for async threads to terminate. hive.server2.table.type.mapping Default Value: CLASSIC Added In: Hive 0.12.0 This setting reflects how HiveServer2 will report the table types for JDBC and other client implementations that retrieve the available tables and supported table types. HIVE: Exposes Hive's native table types like MANAGED_TABLE, EXTERNAL_TABLE, VIRTUAL_VIEW CLASSIC: More generic types like TABLE and VIEW hive.server2.session.hook Default Value: (empty) Added In: Hive 0.12.0 with HIVE-4588 Session-level hook for HiveServer2. hive.server2.max.start.attempts Default Value: 30 Added In: Hive 0.13.0 with HIVE-5794 The number of times HiveServer2 will attempt to start before exiting, sleeping 60 seconds between retries. The default of 30 will keep trying for 30 minutes. hive.server2.async.exec.wait.queue.size Default Value: 100 Added In: Hive 0.13.0 with HIVE-5229 Size of the wait queue for async thread pool in HiveServer2. After hitting this limit, the async thread pool will reject new requests. hive.server2.async.exec.keepalive.time Default Value: 10 Added In: Hive 0.13.0 with HIVE-5229 Time (in seconds) that an idle HiveServer2 async thread (from the thread pool) will wait for a new task to arrive before terminating. hive.server2.long.polling.timeout Default Value: 5000L Added In: Hive 0.13.0 with HIVE-5217 Time in milliseconds that HiveServer2 will wait, before responding to asynchronous calls that use long polling. hive.server2.allow.user.substitution Default Value: true Added In: Hive 0.13.0 Allow alternate user to be specified as part of HiveServer2 open connection request. hive.server2.authentication.spnego.keytab Default Value: (empty) Added In: Hive 0.13.0 Keytab file for SPNEGO principal, optional. A typical value would look like /etc/security/keytabs/spnego.service.keytab. This keytab would be used by HiveServer2 when Kerberos security is enabled and HTTP transport mode is used. This needs to be set only if SPNEGO is to be used in authentication. SPNEGO authentication would be honored only if valid hive.server2.authentication.spnego.principal and hive.server2.authentication.spnego.keytab are specified. hive.server2.authentication.spnego.principal Default Value: (empty) Added In: Hive 0.13.0 SPNEGO service principal, optional. A typical value would look like HTTP/[email protected]. The SPNEGO service principal would be used by HiveServer2 when Kerberos security is enabled and HTTP transport mode is used. This needs to be set only if SPNEGO is to be used in authentication. hive.server2.authentication.pam.services Default Value: (empty) Added In: Hive 0.13.0 with HIVE-6466 List of the underlying PAM services that should be used when hive.server2.authentication type is PAM. A file with the same name must exist in /etc/pam.d. hive.server2.use.SSL Default Value: false Added In: Hive 0.13.0 with HIVE-5351 Set this to true for using SSL encryption in HiveServer2. hive.server2.keystore.path Default Value: (empty) Added In: Hive 0.13.0 with HIVE-5351 SSL certificate keystore location. hive.server2.keystore.password Default Value: (empty) Added In: Hive 0.13.0 with HIVE-5351 SSL certificate keystore password. hive.server2.tez.default.queues Default Value: (empty) Added In: Hive 0.13.0 with HIVE-6325 A list of comma separated values corresponding to YARN queues of the same name. When HiveServer2 is launched in Tez mode, this configuration needs to be set for multiple Tez sessions to run in parallel on the cluster. hive.server2.tez.sessions.per.default.queue Default Value: 1 Added In: Hive 0.13.0 with HIVE-6325 A positive integer that determines the number of Tez sessions that should be launched on each of the queues specified by hive.server2.tez.default.queues. Determines the parallelism on each queue. hive.server2.tez.initialize.default.sessions Default Value: false Added In: Hive 0.13.0 with HIVE-6325 This flag is used in HiveServer 2 to enable a user to use HiveServer 2 without turning on Tez for HiveServer 2. The user could potentially want to run queries over Tez without the pool of sessions. hive.server2.session.check.interval Default Value: 0ms Added In: Hive 0.14.0 with HIVE-5799 The check interval for session/operation timeout, which can be disabled by setting to zero or negative value. hive.server2.idle.session.timeout Default Value: 0ms Added In: Hive 0.14.0 with HIVE-5799 With hive.server2.session.check.interval set to a positive time value, session will be closed when it's not accessed for this duration of time, which can be disabled by setting to zero or negative value. hive.server2.idle.operation.timeout Default Value: 0ms Added In: Hive 0.14.0 with HIVE-5799 With hive.server2.session.check.interval set to a positive time value, operation will be closed when it's not accessed for this duration of time, which can be disabled by setting to zero value. With positive value, it's checked for operations in terminal state only (FINISHED, CANCELED, CLOSED, ERROR). With negative value, it's checked for all of the operations regardless of state. hive.server2.logging.operation.enabled Default Value: true Added In: Hive 0.14.0 with HIVE-4629 and HIVE-8785 When true, HiveServer2 will save operation logs and make them available for clients. hive.server2.logging.operation.log.location Default Value: ${java.io.tmpdir}/${user.name}/operation_logs Added In: Hive 0.14.0 with HIVE-4629 Top level directory where operation logs are stored if logging functionality is enabled. hive.server2.logging.operation.verbose Default Value: false Added In: Hive 0.14.0 with HIVE-8785 When true, HiveServer2 operation logs available for clients will be verbose. 可选的环境设置

      • HIVE_SERVER2_THRIFT_BIND_HOST
        可选择绑定的TCP接口。覆盖配置文件的设置。
      • HIVE_SERVER2_THRIFT_PORT
        可选择监听的TCP端口号。覆盖配置文件的设置。
      • 在HTTP模式下运行 HiveServer2支持通过HTTP传输发送Thrift RPC消息,这个功能在支持客户端和服务器之间加代理服务器尤其有用。目前,用户只能在TCP模式和HTTP模式其一下运行HiveServer2,不能同时在两个模式下运行。下章会有 HiveServer2 provides support for sending Thrift RPC messages over HTTP transport (HIVE-4752). This is particularly useful to support a proxying intermediary between the client and the server (for example, for load balancing or security reasons). Currently, you can run HiveServer2 in either TCP mode or the HTTP mode, but not in both. For the corresponding JDBC URL, check this link: HiveServer2 Clients -- JDBC Connection URLs. Use the following settings to enable HTTP mode:

        See HiveServer2 in the Configuration Properties document for additional properties that can be set for HiveServer2.

        service hive-server2-inceptor1 start

        /usr/lib/hive/bin/beeline

        beeline

        restart inceptor server: /etc/init.d/hive-server-inceptor1 hive-site.xml: /etc/inceptor1/conf/hive-site.xml