hive Could not connect to node01:10000

Could not connect to node01:10000

 

原因

無法連接端口node01節點的10000端口

解決

1、檢查是否開啓hiveserver2服務

hive --service hiveserver2 &

2、檢查10000端口是否被佔用

netstat -anop | grep 10000

端口被佔用就把10000端口殺死重新開啓hiveservice2服務

3、檢查配置文件

在 Hadoop的 core-site.xml 文件添加如下內容

<property>
   <name>hadoop.proxyuser.hadoop.hosts</name>
   <value>*</value>
   <description>
        The 'nfsserver' user is allowed to proxy all members of the 'users-group1' and
       'users-group2' groups. Note that in most cases you will need to include the
        group "root" because the user "root" (which usually belonges to "root" group) will
        generally be the user that initially executes the mount on the NFS client system.
        Set this to '*' to allow nfsserver user to proxy any group.
    </description>
</property>
<property>
       <name>hadoop.proxyuser.hadoop.groups</name>
       <value>*</value>
       <description>
               This is the host where the nfs gateway is running. Set this to '*' to allow
               requests from any hosts to be proxied.
       </description>
</property>

hive-site.xml配置如下.

<configuration>
        <property>
                <name>javax.jdo.option.ConnectionURL</name>
                <value>jdbc:mysql://node01:3306/hive?createDatabaseIfNotExist=true</valu
e>
        </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>123456</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>
                     
        <property>
                <name>hive.server2.thrift.bind.host</name>
                <value>node01</value>
        </property>

        <property>
              <name>hive.metastore.warehouse.dir</name>
              <value>/user/hive/warehouse</value>
        </property>

        <property>
              <name>hive.metastore.uris</name>
              <value>thrift://node01:9083</value>
        </property>
</configuration>

修改之後重啓hadoop集羣和hiveservice2服務

4、檢查hdfs上的兩個目錄權限

hadoop fs -chmod -R 777 /tmp
hadoop fs -chmod -R 777 /user/hive/warehouse

我的問題是第4個,修改權限之後就可以正常連接hive10000端口了

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章