我正在Windows机器上的一个应用程序上工作,该应用程序需要连接到在远程Redhat机器上创建的配置单元表。我正在使用Java Spring Boot。我正在尝试使用以下方式进行连接:
Connection connection = DriverManager.getConnection("jdbc:hive2://my_machine_hostname:10000/mydatabase", "my_username", "mypassword");
我得到这个错误:
java.sql.SQLException: Could not open client transport with JDBC Uri:
jdbc:hive2://my_machine_hostname:10000/my_database:
java.net.ConnectException: Connection timed out: connect
at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:224) ~[hive-jdbc-2.3.4.jar:2.3.4]
at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:107) ~[hive-jdbc-2.3.4.jar:2.3.4]
at java.sql.DriverManager.getConnection(Unknown Source) ~[na:1.8.0_191]
at java.sql.DriverManager.getConnection(Unknown Source) ~[na:1.8.0_191]
at com.orange.SearchEngineHive.Repositories.SearchEngineRepo.getData(SearchEngineRepo.java:44) ~[classes/:na]
当我尝试从另一台计算机连接时,连接成功。