参考文章
hiveserver2的配置和启动
博主:leanaoo
https://blog.csdn.net/leanaoo/article/details/83351240
测试环境是单机版
hive hive-site.xml
<configuration>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://192.168.134.154:3306/hive</value>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>root</value>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>root</value>
</property>
<property>
<name>hive.metastore.schema.verification</name>
<value>false</value>
</property>
<property>
<name>hive.cli.print.current.db</name>
<value>true</value>
</property>
<property>
<name>hive.cli.print.header</name>
<value>true</value>
</property>
<!--hiveserver2-->
<property>
<name>hive.server2.thrift.port</name>
<value>10000</value>
</property>
<property>
<name>hive.server2.thrift.bind.host</name>
<value>hadoop</value>
</property>
<!--WEB UI-->
<property>
<name>hive.server2.webui.host</name>
<value>hadoop</value>
</property>
<property>
<name>hive.server2.webui.port</name>
<value>10002</value>
</property>
</configuration>
如果可以启动无法连接,请在HADOOP core-site.xml添加以下内容
<!--如果连接不上10000-->
<property>
<name>hadoop.proxyuser.root.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.root.groups</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.zhaoshb.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.zhaoshb.groups</name>
<value>*</value>
</property>
JAVA连接需要添加依赖,否则会报错
<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-jdbc</artifactId>
<version>1.1.0</version>
</dependency>
批量插入HIVE
博主:盛装吾步
参考文章:https://blog.csdn.net/kangkangwanwan/article/details/78915134