由於把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');
借鑒: