Support Questions

Find answers, ask questions, and share your expertise

JDBC Connection issue in NIFI on connecting to Teradata

avatar

Hi Team,

I am facing the below issue while connecting Teradata from Nifi in processor "ExecuteSQL".

Error Message:

ExecuteSQL[id=db7852a7-015a-1000] Unable to execute SQL select query sel * from Table where Field1 = 'ABC' due to org.apache.nifi.processor.exception.ProcessException: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory ([Teradata JDBC Driver] [TeraJDBC 15.10.00.26] [Error 1000] [SQLState 08S01] Login failure for Connection to DATABASE Fri Mar 17 05:31:33 EDT 2017 socket orig=DATABASE cid=6829814b sess=0 java.net.UnknownHostException: DATABASE at java.net.InetAddress.getAllByName0(InetAddress.java:1280) at java.net.InetAddress.getAllByName(InetAddress.java:1192) at java.net.InetAddress.getAllByName(InetAddress.java:1126) at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF$Lookup.doLookup(TDNetworkIOIF.java:221) at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF$Lookup.getAddresses(TDNetworkIOIF.java:259) at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF.connectToHost(TDNetworkIOIF.java:367) at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF.createSocketConnection(TDNetworkIOIF.java:154) at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF.<init>(TDNetworkIOIF.java:140) at com.teradata.jdbc.jdbc.GenericTeradataConnection.getIO(GenericTeradataConnection.java:127) at com.teradata.jdbc.jdbc.GenericLogonController.run(GenericLogonController.java:99) at com.teradata.jdbc.jdbc_4.TDSession.<init>(TDSession.java:209) at com.teradata.jdbc.jdk6.JDK6_SQL_Connection.<init>(JDK6_SQL_Connection.java:35)

Please let me know how to resolve this and proceed further.

1 ACCEPTED SOLUTION

avatar

Hi @Gowthaman Jayachandran,

It looks like the JDBC URL you defined in the controller service is not correct and the host cannot be reached from the NiFi servers. What did you configure in the controller service:

13711-screen-shot-2017-03-17-at-123951-pm.png

I believe this URL should be something like:

jdbc:teradata://<host>:<port>/<DatabaseName>

Hope this helps.

View solution in original post

4 REPLIES 4

avatar

Hi @Gowthaman Jayachandran,

It looks like the JDBC URL you defined in the controller service is not correct and the host cannot be reached from the NiFi servers. What did you configure in the controller service:

13711-screen-shot-2017-03-17-at-123951-pm.png

I believe this URL should be something like:

jdbc:teradata://<host>:<port>/<DatabaseName>

Hope this helps.

avatar

Hi @Pierre Villard, Thanks for your prompt response. Eventhough i have modified the URL as per your suggestion, it is throwing the same error. Below are the changes.

DB Connection URL: jdbc:teradata://DATABASE:1025/COTAINER_NAME

Database Driver Class Name: com.teradata.jdbc.TeraDriver

Please let me know how to proceed on it.

avatar

In that case, what you call DATABASE (the server where your teradata is installed) must be reachable from all the NiFi nodes on port 1025. You can check if this working using the following command:

telnet DATABASE 1025

If it is not working then it is a network related issue: you need to allow communication between NiFi nodes and the database.

avatar

@Pierre Villard,

Thanks for your quick response and help. I have changed my host and port to correct one. Now i can able to connect. Appreciate your help.