org.apache.hadoop.ipc.RemoteException: User: root is not allowed to impersonate root
这点就比较恶心了,一般来说,可能只是在hadoop中配置的代理用户不一样,如hadoop is not allowed to impersonate root 或者 root is not allowed to impersonate hive 啥的,但是根据网络上调整后尝试的方法,即对应value上面调整为hadoop 和localhost,没有作用。
我本人的设置为:
这里第三个字段我是root,因为试验环境,我全部用的root,避免权限问题。你可以根据自己的来设置。
beeline> !connect jdbc:hive2://114.215.xxx.xxx:10000/default
Connecting to jdbc:hive2://114.215.xxx.xxx:10000/default
Enter username for jdbc:hive2://114.215.xxx.xxx:10000/default: root
Enter password for jdbc:hive2://114.215.xxx.xxx:10000/default: ************
16/12/05 14:25:23 [main]: WARN jdbc.HiveConnection: Failed to connect to 114.215.xxx.xxx:10000
Error: Could not open client transport with JDBC Uri: jdbc:hive2://114.215.xxx.xxx:10000/default: java.net.ConnectException: Connection refused (state=08S01,code=0)
<property> <name>hive.server2.transport.mode</name>
<value>binary</value>
<description>
Expects one of [binary, http].
Transport mode of HiveServer2.
</description>
</property>
<property> <name>hive.metastore.local</name>
<value>false</value>
<description>controls whether to connect to remote metastore server or open a new metastore server in Hive Client JVM</description>
</property>
<property>
<name>hive.metastore.uris</name>
<value>thrift://114.215.xxx.xxx:9083</value>
<description>Thrift URI for the remote metastore. Used by metastore client to connect to remote metastore.</description>
</property>
另外,几个默认配置为0.0.0.0的地方不要轻易改动。除非你明确的知道修改的目的,否则请默认设置。
<property> <name>hive.hwi.listen.host</name>
<value>0.0.0.0</value>
<description>This is the host address the Hive Web Interface will listen on</description>
</property>
<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>