我正在尝试使用 JDBC 访问 Hive 元数据。我已经在类路径中添加了所有需要的 jar 文件。我从这里开始学习教程-https://cwiki.apache.org/confluence/display/Hive/HiveClient#HiveClient-JDBC
添加所有 jar 文件后,我尝试编写一个示例程序以使用 Java 连接到 Hive。当我调试代码时,只要它到达下面的行。
Connection con =
DriverManager.getConnection("jdbc:hive://lvsaishdc3in0001.lvs.host.com:10000/
default","", "");
我总是得到这个例外。不知道为什么会这样。谁能帮我解决这个问题?
java.sql.SQLException: Could not establish connection to
lvsaishdc3in0001.lvs.host.com:10000/default: java.net.ConnectException: Connection
timed out: connect
我通过登录 Putty 并传递主机名来启动我的 Hive 服务器。
$ bash
bash-3.00$ cd /usr/local/bin
bash-3.00$ hive --service hiveserver
Starting Hive Thrift Server
12/07/03 08:07:11 INFO service.HiveServer: Starting hive server on port 10000