1.eclipse创建项目
2.引入hive jar包
将hive/lib下的所有jar包引入
3.修改Hive-site.xml配置
使用OS操作系统的认证方式
[hive-site.xml]
<!-- 调度Yarn的时候是否以Hive用户身份,false已Hive默认用户身份,true以访问用户 -->
<!-- 为true时报错 -->
<property>
<name>hive.server2.enable.doAs</name>
<value>false</value>
<description>
Setting this property to true will have HiveServer2 execute
Hive operations as the user making the calls to it.
</description>
</property>
<!-- hive元数据验证 -->
<property>
<name>hive.metastore.sasl.enabled</name>
<value>false</value>
<description>If true, the metastore Thrift interface will be secured with SASL. Clients must authenticate with Kerberos.</description>
</property>
<!-- hive验证方式 -->
<property>
<name>hive.server2.authentication</name>
<value>NONE