在hive启动的时候总是出现一下的错误:
java.sql.SQLException: Unable to open a test connection to the given database. JDBC url = jdbc:mysql://master.hadoop:3306/hive?createDatabaseIfNotExist=true, username = root. Terminating connection pool (set lazyInit to true if you expect to start your database after your app). Original Exception: ------
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
因为hive配置的元数据在mysql里面,而且mysql是和集群的namenode安装在一台机器上。
由于集群被重启了,而mysql又么有启动,所以就出了以上问题。
使用命令: service mysqld start
然后在启动hive,问题解决。