Skip to content

Cannot connect to Oracle on-prem from Glue

0

Hi, I would appreciate any help on how I can connect or test the connection to Oracle on-prem either from Glue or other services. I followed the steps from this article https://aws.amazon.com/blogs/big-data/how-to-access-and-analyze-on-premises-data-stores-using-aws-glue/.

I tried both Glue's default driver and custom driver (using ojdbc10.jar). I created a visual job in Glue and the data preview tab is giving the error below.

URL - jdbc:oracle:thin:@//fffffff.xx.edu:1521/svcsdsd.xx.edu class name - oracle.jdbc.driver.OracleDriver

Py4JJavaError - An error occurred while calling o103.getDynamicFrame. : java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection (CONNECTION_ID=88DGxhoCR5GUEOIoEaPSBA==) at oracle.jdbc.driver.T4CConnection.handleLogonNetException(T4CConnection.java:892) at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:697) at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:1041) at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:89) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:732) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:648) at com.amazonaws.services.glue.util.JDBCWrapper$.$anonfun$connectionProperties$5(JDBCUtils.scala:1120) at com.amazonaws.services.glue.util.JDBCWrapper$.$anonfun$connectWithSSLAttempt$2(JDBCUtils.scala:1071) at scala.Option.getOrElse(Option.scala:189) at com.amazonaws.services.glue.util.JDBCWrapper$.$anonfun$connectWithSSLAttempt$1(JDBCUtils.scala:1071) at

asked a year ago1.4K views
1 Answer
1
Accepted Answer

If Glue is connected to a VPC with connectivity to the on-premises database, as described in the blog post, then is DNS resolution for the internal database name configured as described in the "Other considerations for a hybrid setup" section of the blog post? Does the security group attached to Glue's ENI (elastic network interface) and the rules on any potential on-premises firewalls allow access from Glue's ENI to both the database and the DNS servers? Did you have TLS/SSL encryption enabled/enforced for the JDBC connection?

If you happen to have an EC2 instance in the same VPC, could you test if you can connect to the database from there?

If it isn't easy to confirm the DNS setup, perhaps just to narrow down the problem, you could temporarily try configuring the connection with the database's IP address, so that DNS resolution isn't needed. If that helps, then it's most likely a DNS issue and the configuration for it explained in the blog post would be the first item to check.

EXPERT
answered a year ago
EXPERT
reviewed a year ago
  • @Leo K, thank you for your response! I configured the connection using the database ip address. But I'm still getting the same error. No, I don't have TLS/SSL encryption enabled.

    I'm pretty new to AWS and Glue. Do you by chance have a guide on how to test this in EC2? I appreciate your help. Thank you!

  • If you have an EC2 instance in the same VPC, make sure that the security group(s) attached to it allow outbound traffic towards the Oracle database. By default, all outbound traffic is permitted, so this is probably already okay. Then just log on to the EC2 instance over SSH or RDP and try connecting to the Oracle database's TCP port 1521 with any tool, such as telnet. If it doesn't work, even with the IP address, then you probably haven't got connectivity to the on-premises network. Is the connectivity arranged in the way explained in the blog post?

  • @Leo K I created an ec2 instance and ran traceroute and sent it to our network team. They adjusted the firewall rules on their end. The connection worked! Thank you!

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.