hive 配置

Last updated on November 22, 2024 pm

🧙 Questions

hive组件配置

☄️Ideas

hive-site.xml
sudo vim /opt/hive/conf/hive-site.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>


    <!-- ispong :) 配置hive业务数据库的url -->
    <property>
        <name>javax.jdo.option.ConnectionURL</name>
        <value>jdbc:mysql://isxcode:30002/hive_db?createDatabaseIfNoExist=true&amp;useSSL=false&amp;useUnicode=true&amp;characterEncoding=UTF-8</value>
    </property>
        
    <!-- ispong :) 配置数据源驱动 -->
    <property>
        <name>javax.jdo.option.ConnectionDriverName</name>
        <value>com.mysql.cj.jdbc.Driver</value>
    </property>
    
   <!-- ispong :) 配置数据源账号 -->
    <property>
        <name>javax.jdo.option.ConnectionUserName</name>
        <value>ispong</value>
    </property>
    
    <!--ispong :) 配置数据源密码 -->
    <property>
        <name>javax.jdo.option.ConnectionPassword</name>
        <value>ispong123</value>
    </property>
  
    <!-- ispong :) 配置数据储存hdfs中的位置 -->
    <property>
        <name>hive.metastore.warehouse.dir</name>
        <value>/data/hive-data/warehouse</value>
    </property>
        
    <!-- ispong :) hive.metastore.port服务端口号 -->
    <property>
        <name>hive.metastore.port</name>
        <value>30116</value>
    </property>
    
    <!-- ispong :) 配置hive账号密码 -->
    <property>
        <name>hive.server2.authentication</name>
        <value>NONE</value>
    </property>

    <!-- ispong :) 账号密码 -->
    <property>
        <name>hive.server2.custom.authentication.class</name>
        <value>password</value>
    </property>

    <!--  ispong :) hive server hive2 配置端口号-->
    <property>
        <name>hive.server2.thrift.port</name>
        <value>30117</value>
    </property>
    
    <!-- ispong :) 解决权限问题  全部以hive去执行-->
    <property>
        <name>hive.server2.enable.doAs</name>
        <value>false</value>
    </property>
    
    <!-- ispong :) 访问地址 -->
    <property>
        <name>hive.server2.webui.host</name>
        <value>0.0.0.0</value>
        <description>The host address the HiveServer2 WebUI will listen on</description>
    </property>

    <!-- ispong :) hive web ui 端口号开放 -->
    <property>
        <name>hive.server2.webui.port</name>
        <value>30118</value>
    </property>

    <!-- ispong :) 开启本地运行模式 -->
    <property>
        <name>hive.exec.mode.local.auto</name>
        <value>true</value>
    </property>

    <!-- ispong :) 开启hive并发运行  -->
    <property>
        <name>hive.exec.parallel</name>
        <value>true</value>
    </property>

    <!-- ispong :) 不使用权限控制 默认值 true, true 则会走linux用户权限 false则任何人都可以进入-->
    <property>
        <name>hive.server2.enable.doAs</name>
        <value>true</value>
    </property>

    <!-- ispong :) 配置自定义密码 -->
    <property>
    <name>hive.server2.authentication</name>
    <value>CUSTOM</value>
    <description>
      Expects one of [nosasl, none, ldap, kerberos, pam, custom].
      Client authentication types.
        NONE: no authentication check
        LDAP: LDAP/AD based authentication
        KERBEROS: Kerberos/GSSAPI authentication
        CUSTOM: Custom authentication provider
                (Use with property hive.server2.custom.authentication.class)
        PAM: Pluggable authentication module
        NOSASL:  Raw transport
    </description>
  </property>

   <property>
    <name>hive.server2.custom.authentication.class</name>
    <value/>
    <description>
      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 implement Hadoop's
      org.apache.hadoop.conf.Configurable class to grab Hive's Configuration object.
    </description>
   </property>

    <!-- ispong:) 设置分区大小,Default Value: strict -->
    <!-- 在严格模式下,用户必须至少指定一个静态分区,以防用户不小心覆盖所有分区。在非严格模式下,所有分区都允许是动态的。 -->
    <property>
        <name>hive.exec.dynamic.partition.mode</name>
        <value>strict</value>
    </property>

    <!-- ispong:) 设置分区大小,Default Value: false -->
    <!-- 是否允许 DML/DDL 中的动态分区。。 -->
    <property>
        <name>hive.exec.dynamic.partition</name>
        <value>false</value>
    </property>

    <!-- ispong:) 设置分区大小,Default Value: 100 -->
    <!-- 允许在每个映射器/减速器节点中创建的动态分区的最大数量。 -->
    <property>
        <name>hive.exec.max.dynamic.partitions.pernode</name>
        <value>100</value>
    </property>

</configuration>

hive 配置
https://ispong.isxcode.com/hadoop/hive/hive 配置/
Author
ispong
Posted on
December 30, 2020
Licensed under