IOException:网络适配器无法建立连接 [英] IOException: Network adapter could not establish the connection

查看:1044
本文介绍了IOException:网络适配器无法建立连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们不时在我们的生产环境中开始有这个网络适配器无法建立连接的问题,我做了很多谷歌并在这里经历了一些问题,但仍然没有得到解决方案。

We started to have this "Network adapter could not establish the connection" problem in our production environment from time to time, I did a lot of google and went through some questions here but still didn't get the solution.

以下是有关我们环境的一些信息:

Here are some information about our environment:


  1. 我们正在使用RAC 2个oracle实例(版本10.2.0.4)。

  2. 我们在RAC上运行了几个应用服务器(JBoss AS5)。

  3. 连接oracle-ds.xml中的url是jdbc:oracle:thin:@(DESCRIPTION =(ADDRESS_LIST =(ADDRESS =(PROTOCOL = TCP)(HOST = db1_vip)(PORT = 1521))(ADDRESS =(PROTOCOL = TCP)( HOST = db2_vip)(PORT = 1521))(LOAD_BALANCE = yes))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = G1db)(FAILOVER_MODE =(TYPE = SELECT)(METHOD = BASIC)(RETRIES = 120)(DELAY = 5))))

  4. 我们将db1_vip / db2_vip以及2个oracle实例的实际ip添加到两个应用服务器的/ etc / hosts中

  5. oracle实例和app服务器之间有防火墙,但是我们在两个oracle实例上都打开了1521端口。

  1. We are using RAC with 2 oracle instances (version 10.2.0.4).
  2. We have several app servers (JBoss AS5) running on top of the RAC.
  3. The connection url in oracle-ds.xml is "jdbc:oracle:thin:@(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = db1_vip)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST=db2_vip)(PORT = 1521))(LOAD_BALANCE = yes))(CONNECT_DATA=(SERVER = DEDICATED)(SERVICE_NAME = G1db)(FAILOVER_MODE =(TYPE =SELECT)(METHOD = BASIC)(RETRIES = 120)(DELAY = 5))))"
  4. We added db1_vip/db2_vip as well the actual ip of 2 oracle instances to the /etc/hosts of both app servers
  5. There IS firewall between oracle instances and app servers, but we opened the 1521 port on both oracle instances.

我们运行了以下测试检查网络或oracle TNS监听器是否有任何问题:

We've run following tests to check if there is any problem on network or oracle TNS listener:


  1. 从app服务器运行ping到两个oracle实例,一切正常,没有任何数据包丢失。

  2. telnet 1521端口从app服务器到两个oracle实例,没有错。

  3. tnsping工作正常。

  4. 我们检查了监听器日志,但没有发现任何有价值的内容。

  1. run ping from app servers to both oracle instances, everything works fine without any packet loss.
  2. telnet the 1521 port from app servers to both oracle instances, nothing wrong.
  3. tnsping also works fine.
  4. We checked listener log but found nothing valuable.

最奇怪的是,这个错误在一台应用服务器上每小时发生10次左右,但在另一台应用服务器上每天只发生1或2次。

The most weird thing is that this error happens around 10 times an hour on one app server, but only happens 1 or 2 times a day on another app server.

有人可以解释这个错误吗?

Can anyone shed some light on this error?

谢谢

:我们在找到一个oracle实例时发现超时问题,所以我们改变了jdbc url只连接一个实例,发现IOException再也没发生过,所以我们认为问题与数据库有关,DBA团队会继续看进入这个。

:我们做了以下尝试:

: We did following tries:


  1. 禁用了应用服务器和之间的防火墙数据库服务器

  2. 使用ip而不是主机名

  3. 使用wireshark检查是否存在任何tcp数据包问题。

没有一个成功,有人请求帮助〜

none of them succeed, someone please help~

:错误堆栈跟踪:

java.sql.SQLException: Io Exception: The Network Adapter could not establish the connection
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:414)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
    at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:207)
    ... 5 more


推荐答案

错误


java.sql.SQLException:Io异常:网络适配器无法
建立连接

java.sql.SQLException: Io Exception: The Network Adapter could not establish the connection

Java / JDBC 无关。
这是您的网络设置出现问题时的错误。我的猜测,防火墙问题。你可以禁用它,看看错误是否仍然存在?

has nothing to do with Java/JDBC. This is the error you get when there's something wrong with your network setup. My guess, firewall problem. Can you disable it and see if the error is still there?

这篇关于IOException:网络适配器无法建立连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆