I am using SymmetricDS to synchronise data between a server (Windows 10 machine) and client (Ubuntu Machine - Google Compute Engine) database. This requires me to set up a connection between the two systems.
I created a SSH tunnel using PuTTY on the Windows Machine to the Client and all of that is working fine.
Of course, when the connection closes uncleanly/unexpectedly, the SSH connection to the client machine terminates and needs to be restarted manually. I am therefore trying a fork of PuTTY, which is called KiTTY. Kitty has an option to automatically restart the SSH connection.
My aim is to have SymmetricDS resume synchronisation once the ssh connection has been restored by KiTTY.
The issue I am facing:
I start SymmetricDS on both machines and the ssh connection on the server. (Everything works perfectly). I then purposefully disconnect the ethernet cable. I then wait for 30 seconds or so and then restore the internet connection. KiTTY then automatically restarts the ssh connection. However, SymmetricDS does not resume synchronisation. It throws the following error client side:
DataLoaderService - Failed to process batch java.net.SocketTimeoutException: Read timed out
at java.base/java.net.SocketInputStream.socketRead0(Native Method)
at java.base/java.net.SocketInputStream.socketRead(SocketInputStream.java:115)
at java.base/java.net.SocketInputStream.read(SocketInputStream.java:168)
at java.base/java.net.SocketInputStream.read(SocketInputStream.java:140)
...etc
Before disconnecting the internet, I did a check of the ports that were being used:
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1382/sshd
tcp 0 0 0.0.0.0:31415 0.0.0.0:* LISTEN 2110/java
tcp 0 0 127.0.0.1:9090 0.0.0.0:* LISTEN 1972/sshd: gce_uname@p
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 1364/mysqld
After the internet connection has been dropped and restored, I again did the same check:
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1382/sshd
tcp 0 0 0.0.0.0:31415 0.0.0.0:* LISTEN 2110/java
tcp 0 0 127.0.0.1:9090 0.0.0.0:* LISTEN 1972/sshd: gce_uname@p
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 1364/mysqld
Which shows no change.
I then stop SymmetricDS and it free's port 31415 (which it uses):
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1382/sshd
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 1364/mysqld
When I start symmetricDS again, it starts listening on port 31415 again:
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1382/sshd
tcp 0 0 0.0.0.0:31415 0.0.0.0:* LISTEN 2110/java
tcp 0 0 127.0.0.1:9090 0.0.0.0:* LISTEN 1972/sshd: gce_uname@p
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 1364/mysqld
but again throws the error:
Could not communicate with omni:000:000 at http://localhost:9090/sync/omni-000 because: java.net.ConnectException: Connection refused (Connection refused)
I have tested this several times, but keeps throwing the same error.
Any ideas?
SymmetricDS is just like any other Java application that uses your network. Try testing the connection by visiting http://localhost:9090/sync/omni-000/ping in your web browser. If this problem reoccurs using other applications, then it is likely a problem with your network.