java.net.SocketException: ресурс временно недоступен
Привет, у нас есть два сервера, работающих одновременно в производственной среде. Иногда server1 генерирует исключение "java.net.SocketException: ресурс временно недоступен". Ниже приведены подробности,
Заранее спасибо:)
Failed to connect to ssh server [10.0.0.0:22]
org.apache.sshd.common.RuntimeSshException: Failed to get the session.
at org.apache.sshd.client.future.DefaultConnectFuture.getSession(DefaultConnectFuture.java:43)
at com.abc.OurSshClient.getSessionWithTimeOut(OurSshClient.java:328)
at com.abc.OurSshClient.connect(OurSshClient.java:228)
at com.abc.spi.ConnectionImpl.connectToServer(ConnectionImpl.java:92)
at com.abc.spi.ConnectionImpl.<init>(ConnectionImpl.java:84)
at com.abc.spi.ConnectionFactoryImpl.getInvalidConnections(ConnectionFactoryImpl.java:97)
at com.abc.resource.pool.ConnectionPoolRegistry.runHeartBeatCheck(ConnectionPoolRegistry.java:303)
at com.abc.resource.pool.ConnectionPoolRegistry$CheckConnectionThread.run(ConnectionPoolRegistry.java:498)
Caused by: java.net.SocketException: Resource temporarily unavailable
at sun.nio.ch.Net.connect0(Native Method)
at sun.nio.ch.Net.connect(Net.java:484)
at sun.nio.ch.Net.connect(Net.java:476)
at sun.nio.ch.UnixAsynchronousSocketChannelImpl.implConnect(UnixAsynchronousSocketChannelImpl.java:326)
at sun.nio.ch.AsynchronousSocketChannelImpl.connect(AsynchronousSocketChannelImpl.java:209)
at org.apache.sshd.common.io.nio2.Nio2Connector.connect(Nio2Connector.java:53)
at org.apache.sshd.SshClient.connect(SshClient.java:298)
at org.apache.sshd.SshClient.connect(SshClient.java:284)
at org.apache.sshd.SshClient.connect(SshClient.java:274)
at com.abc.OurSshClient.getSessionWithTimeOut(OurSshClient.java:317)
... 6 more
private ClientSession getSession(int connectionTimeout) throws TimeoutException, IOException {
ConnectFuture connection;
boolean hasTimedOut = true;
try {
connection = this.client.connect(username, host, port);
hasTimedOut = !connection.await(connectionTimeout);
} catch (Exception e) {
throw new IOException("Failed to connect", e);
}
if (hasTimedOut) {
this.client.stop();
this.client = null;
this.clientStarted = false;
throw new TimeoutException("TimeOut Exception while attempting to connect to [" + host + "]:[" + port + "]");
}
return connection.getSession();
}
1 ответ
Мы только что изменили диапазоны портов в файле конфигурации eVip, и теперь он работает хорошо.
Спасибо вам всем:)