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 & 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>
core-site.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 终端并继续。