Execute by SQL
select * from cities limit 10;
report errors
FAILED: SemanticException Unable to determine if hdfs://localhost:9000/user/hive/warehouse/cities is encrypted: org.apache.hadoop.hive.ql.metadata.HiveException: java.net.ConnectException: Call From bigdata/192.168.224.130 to localhost:9000 failed on connection exception: java.net.ConnectException: Connection refused; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused
The reason is that the metadata information of hive is stored in DBS and SDS in MySQL. I modified the fs.xml of core site defaultFS,
Cause metadata mismatch.
primary
<configuration> <property> <name>fs.defaultFS</name> <value>hdfs://bigdata:9000</value> </property> <property>
present
<configuration> <property> <name>fs.defaultFS</name> <value>hdfs://bigdata:9000</value> </property> <property>
So the solution is to modify
update DBS set DB_LOCATION_URI=REPLACE (DB_LOCATION_URI,'localhost:9000','bigdata:9000'); update SDS set LOCATION=REPLACE (LOCATION,'localhost:9000','bigdata:9000');