报错如下:
21/12/16 15:12:34 [main]: WARN jdbc.HiveConnection: Failed to connect to hadoop100:10000
Could not open connection to the HS2 server. Please check the server URI and if the URI is correct, then ask the administrator to check the server status.
Error: Could not open client transport with JDBC Uri: jdbc:hive2://hadoop100:10000: java.net.ConnectException: 拒绝连接 (Connection refused) (state=08S01,code=0)
原因:hadoop没设置权限
配置hadoop中的core-site.xml文件,允许hive访问
<!-- 配置访问hadoop的权限,能够让hive访问到 -->
<property>
<name>hadoop.proxyuser.atguigu.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.atguigu.groups</name>
<value>*</value>
</property>
配置完成之后,需要重启整个hadoop集群。