首页 > 解决方案 > 在 mac os 中在 hive 中创建表时出现错误 localhost:9000 连接失败

问题描述

hive> 如果不存在则创建架构 inconv_seql; 失败:执行错误,从 org.apache.hadoop.hive.ql.exec.DDLTask 返回代码 1。MetaException(message:Got exception: java.net.ConnectException Call From User-MacBook-Air.local/127.0.0.1 to localhost:9000 failed on connection exception: java.net.ConnectException: Connection denied; 有关详细信息,请参阅: http: //wiki.apache.org/hadoop/ConnectionRefused )

标签: macoshadoophive

解决方案


localhost:9000 failed on connection exception: java.net.ConnectException: Connection refused;

上述错误是由于带有端口9000的 hadoop 恶魔未在您的本地计算机上运行,

请按照以下步骤启动 hadoop,然后启动 hive。

1.检查hadoop是否运行,

hduser@ubuntu:~$ jps

如果您找不到在本地运行的任何 hadoop 守护进程,请按照以下命令启动 hadoop,

hduser@ubuntu:~$ $HADOOP_HOME/sbin/start-all.sh

2.检查hive-site.xml,core-site.xml hive-site.xml

<property> 
<name>hive.metastore.db.type</name> 
<value>DERBY</value> 
<description> Expects one of [derby, oracle, mysql, mssql, postgres]. Type of database used by the metastore. Information schema &amp; JDBCStorageHandler depend on it. </description> 
</property> 
<property> 
<name>hive.metastore.warehouse.dir</name> 
<value>hdfs://localhost:8020/user/hive/warehouse</value> 
<description>location of default database for the warehouse</description> </property>

核心站点.xml

<configuration> 
<property> 
<name>hadoop.tmp.dir</name> 
<value>/usr/local/Cellar/hadoop/hdfs/tmp</value> 
<description>A base for other temporary directories</description> 
</property> 
<property> 
<name>fs.default.name</name> 
<value>hdfs://localhost:8020</value> 
</property> 
</configuration>

并尝试启动 hive 终端并继续。


推荐阅读