如何配置从Bluemix到内部部署数据库的连接?

时间:2016-06-01 21:30:45

标签: database ibm-cloud secure-gateway

我在IBM Bluemix上配置了Secure Gateway服务,然后在我的环境中配置了Secure Gateway客户端。两者都是相连的。此后,我使用提供的host:port组合从我的云应用添加了一个连接呼叫。该应用收到错误connection refused

我该如何解决这个问题?

2 个答案:

答案 0 :(得分:0)

在大多数情况下,错误是由以下原因之一引起的:

  • 在Secure Gateway配置中,您必须提供本地数据库的IP地址和端口,从Secure Gateway客户端运行的位置可以看出。您提供了正确的IP地址和端口号吗?
  • 数据库服务器上的防火墙阻止从Secure Gateway客户端访问。
  • Secure Gateway客户端需要一个可以打开连接的ACL(访问控制列表)。
  • 您的数据库未配置为从外部访问。你打开了港口吗?

答案 1 :(得分:0)

i changed the db type from DB2 As400 to  normal db2. Now i have this error : 

ERR App [err] com.ibm.db2.jcc.am.DisconnectNonTransientConnectionException: [jcc][t4][2030][11211][4.12.55] A communication error occurred during operations on the connection's underlying socket, socket input stream,
ERR App or socket output stream.  Error location: Reply.fill() - insufficient data (-1).  Message: Insufficient data. ERRORCODE=-4499, SQLSTATE=08001
ERR App [err]   at com.ibm.db2.jcc.am.hd.a(hd.java:319)
ERR App [err]   at com.ibm.db2.jcc.t4.a.a(a.java:461)
ERR App [err]   at com.ibm.db2.jcc.t4.a.a(a.java:456)
ERR App [err]   at com.ibm.db2.jcc.t4.z.b(z.java:242)
ERR App [err]   at com.ibm.db2.jcc.t4.z.c(z.java:268)
ERR App [err]   at com.ibm.db2.jcc.t4.z.c(z.java:381)
ERR App [err]   at com.ibm.db2.jcc.t4.z.v(z.java:1149)
ERR App [err]   at com.ibm.db2.jcc.t4.ab.a(ab.java:45)
ERR App [err]   at com.ibm.db2.jcc.t4.b.n(b.java:1251)
ERR App [err]   at com.ibm.db2.jcc.t4.b.b(b.java:1123)
ERR App [err]   at com.ibm.db2.jcc.t4.b.d(b.java:717)
ERR App [err]   at com.ibm.db2.jcc.t4.b.c(b.java:703)
ERR App [err]   at com.ibm.db2.jcc.t4.b.a(b.java:391)
ERR App [err]   at com.ibm.db2.jcc.t4.b.<init>(b.java:320)
ERR App [err]   at com.ibm.db2.jcc.DB2SimpleDataSource.getConnection(DB2SimpleDataSource.java:214)
ERR App [err]   at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:460)
ERR App [err]   at java.sql.DriverManager.getConnection(Unknown Source)
ERR App [err]   at java.sql.DriverManager.getConnection(Unknown Source)
ERR App [err]   at wasdev.sample.servlet.DBServlet.getTargetDBConnection(DBServlet.java:136)
ERR App [err]   at wasdev.sample.servlet.DBServlet.doGet(DBServlet.java:57)
ERR App [err]   at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
ERR App [err]   at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
ERR App [err]   at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1290)
ERR App [err]   at [internal classes]
ERR App [err]   at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
ERR App [err]   at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
ERR App [err]   at java.lang.Thread.run(Unknown Source)