通过启动脚本:
cd $HIVE_HOME
./bin/hive --hiveconf hive.root.logger=DEBUG,console
启动报如下错误:
16/08/25 19:06:18 [main]: DEBUG bonecp.BoneCPDataSource: JDBC URL =
jdbc:mysql://slave1:3306/hive?createDatabaseIfNotExist=true
, Username = hive, partitions = 1, max (per partition) = 10, min (per partition) = 0, idle max age = 60 min, idle test period = 240 min, strategy = DEFAULT
16/08/25 19:06:19 [BoneCP-pool-watch-thread]: ERROR bonecp.BoneCP: Failed to acquire connection to
jdbc:mysql://slave1:3306/hive?createDatabaseIfNotExist=true
. Sleeping for 7000 ms. Attempts left: 5
java.sql.SQLException: No suitable driver found for
jdbc:mysql://slave1:3306/hive?createDatabaseIfNotExist=true
at java.sql.DriverManager.getConnection(DriverManager.java:689)
at java.sql.DriverManager.getConnection(DriverManager.java:208)
at com.jolbox.bonecp.BoneCP.obtainRawInternalConnection(BoneCP.java:361)
at com.jolbox.bonecp.BoneCP.obtainInternalConnection(BoneCP.java:269)
at com.jolbox.bonecp.ConnectionHandle.<init>(ConnectionHandle.java:242)
at com.jolbox.bonecp.PoolWatchThread.fillConnections(PoolWatchThread.java:115)
at com.jolbox.bonecp.PoolWatchThread.run(PoolWatchThread.java:82)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
这是报没有找到连接mysql的jdbc驱动,但是实际上$HIVE_HOME/lib下已经有mysql的驱动包了