由于把hadoop的以下配置项
<property>
<name>fs.defaultFS</name>
<value>hdfs://localhost:9000</value>
</property>
改为
<property>
<name>fs.defaultFS</name>
<value>hdfs://192.168.65.128:9000</value>
</property>
导致hive select的时候出现以下错误:
SemanticException Unable to determine if hdfs://localhost:9000/user/hive/warehouse/t1.db/student is encrypted: org.apache.hadoop.hive.ql.metadata.HiveException: java.net.ConnectException: Call From localhost/127.0.0.1 to localhost:9000 failed on connection exception: java.net.ConnectException: Connection refused; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused
这种情况一般是hive的数据存储路径不对,直接去mysql里修改hive的原数据就可以:
mysql执行如下命令:
use hive;
update DBS set DB_LOCATION_URI=REPLACE (DB_LOCATION_URI,'localhost','192.168.65.128')
update SDS set LOCATION=REPLACE (LOCATION,'localhost','192.168.65.128');
借鉴: