简体   繁体   English

Talend无法连接到PostgreSQL

[英]Talend failing connection to PostgreSQL

I am currently creating an ETL job in talend which is connecting to a PostgreSQL database and I ran into a connection error. 我目前正在连接到PostgreSQL数据库的talend中创建ETL作业,但遇到连接错误。

I have set up a db connection in my talend repository with all the connection details I need to connect to my postgreSQL database and saved as 'mydbconnection', which specific database schema specified. 我已经在talend存储库中建立了一个数据库连接,其中包含了连接到postgreSQL数据库所需的所有连接详细信息,并保存为“ mydbconnection”,即指定的特定数据库架构。

I have used mydbconnection in tPostgreSQLOutput and tPostgreSQLInput and both worked perfectly. 我在tPostgreSQLOutputtPostgreSQLInput使用了mydbconnection ,两者都工作得很好。 However, when I use that same connection from the repository in a tEltPostgreSQLOutput_1 it throws an error (see below). 但是,当我在tEltPostgreSQLOutput_1的存储库中使用相同的连接时,会引发错误(请参见下文)。

  1. I have tried the following to resolve it : 我尝试了以下解决方案
    1. Check the connection details in repository and ran 'Test connection' and all was ok 检查存储库中的连接详细信息并运行“测试连接”,一切正常
    2. Made sure the user name has privileges over this task - all ok 确保用户名对此任务具有特权-一切正常
    3. Checked the max number of sessions the user talend is connecting with can have - ok 检查了用户talend连接的最大会话数-可以
    4. Checked the max number of sessions the database server is willing to accept - all ok 检查数据库服务器愿意接受的最大会话数-一切正常
    5. Checked the database logs - no thing recorded (not even 'failed connection attempt') 检查数据库日志-没有记录(甚至没有“失败的连接尝试”)
    6. Checked the version of java on my machine - v7 is supported by latest talend. 检查了我机器上的Java版本-最新的talend支持v7。
    7. Searched the previous questions here! 在这里搜索以前的问题!

... and have no idea where to go from here. ...而且不知道从这里去哪里。 Does anyone know of any other good lines of investigation to resolve this? 有谁知道其他解决这个问题的好方法?

Error message : 错误讯息

Exception in component tELTPostgresqlOutput_1
org.postgresql.util.PSQLException: The connection attempt failed.
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:137)
    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
    at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:124)
    at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
    at org.postgresql.jdbc3.Jdbc3Connection.<init>(Jdbc3Connection.java:24)
    at org.postgresql.Driver.makeConnection(Driver.java:386)
    at org.postgresql.Driver.connect(Driver.java:260)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at zurich_segmentation_prod.is_300_customer_new_0_1.is_300_customer_new.tELTPostgresqlMap_1Process(is_300_customer_new.java:338)
    at zurich_segmentation_prod.is_300_customer_new_0_1.is_300_customer_new.runJobInTOS(is_300_customer_new.java:602)
    at zurich_segmentation_prod.is_300_customer_new_0_1.is_300_customer_new.main(is_300_customer_new.java:470)

for anyone who runs into this problem in the future.. i found a way around it. 对于将来遇到此问题的任何人..我找到了解决之道。 I added a tPostgreSQLConnection to my workspace, then ticked the option in my tELTPostgreSQLMap to 'use existing connection' this then seems to remain connected when the work flow reaches the tEltPostgreSQLOutput component. 我在工作空间中添加了一个tPostgreSQLConnection,然后在我的tELTPostgreSQLMap中选中了“使用现有连接”选项,当工作流程到达tEltPostgreSQLOutput组件时,该选项似乎保持连接状态。 It's not pretty but it works. 它不是很漂亮,但是可以。 The more obvious way (the way i had initial done it) does not work. 更明显的方式(我最初做的方式)不起作用。 A bug has been added to Talend's JIRA for this exact scenario. 针对此确切情况,已在Talend的JIRA中添加了一个错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM