Connectivity and network¶
Problems reaching a source, a destination, the Capture Agent or the Replicator Service over the network. For the ports SQDR use, see Ports.
Test connectivity to a database¶
First, gather the basics
- Is this a new setup, or did something that worked stop working? If it stopped, what changed (network, firewall, passwords, certificates, a database move)?
- Check the host name, port and database name (for Db2, the RDB name). If you use a host name, check that it resolves
(
nslookup <host>). - Check that the database is running.
- Verify the source or destination: it connects with the settings as entered and shows the driver's error (see Testing the connection).
Then test the network path, from the computer that makes the connection (the Stelo VM for the Replicator Service, the Stelo VM for a Capture Agent):
| Tool | How to use it | What it proves |
|---|---|---|
ping |
ping <host> |
Little: firewalls often block it, and pings can fail while the database is reachable. Use it for the black hole router test. |
Test-NetConnection |
In PowerShell: Test-NetConnection -ComputerName <host> -Port <port>. TcpTestSucceeded : True means the port answers. |
That the database's port is reachable through the network and firewalls. This is the most useful first test. |
| Telnet or PuTTY | telnet <host> <port>, or PuTTY with the host, the port and the connection type Raw or Telnet. A connection that stays open (even with nothing shown) means the port answers. The Windows Telnet Client is an optional Windows feature that must be turned on first. |
The same as Test-NetConnection. |
| ODBC Data Source Administrator | Many ODBC drivers have a Test button in their data source (DSN) setup. Stelo recommends connection strings for SQDR, but a DSN made only for the test is fine. | That the driver can connect with these settings. |
odbctest |
Microsoft's ODBC test application. With a DSN: Conn › Full Connect..., choose the DSN and enter the credentials. With a connection string, see below. | That the driver connects with exactly the connection string SQDR uses. |
isql |
A command-line ODBC query tool: isql -v -k "<connection string>". It's in the Stelo Replicator container (run it from a login shell; see Manage the Docker container); for Windows, ask Stelo Support. |
The same as odbctest, from the command line. |
jping |
On the Stelo VM, SQDR Plus (64-bit) › Tools › JPing - Verify IBM i host servers. See Verifying connectivity to host servers. | That the IBM i host servers, which a Db2 for i Capture Agent (and the IBM i Access ODBC driver) uses, are running and reachable. |
To prove the network path and the driver without the right credentials, connect with a made-up user and password: an "invalid user or password" error from the database shows that you reached it.
Testing a connection string with odbctest
The connection string is the one you use in SQDR, with the driver name added (DRIVER=...;). The driver names are in
the ODBC Data Source Administrator's Drivers tab, or under the registry key
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI.
- Env › SQLAllocHandle, handle type
SQL_HANDLE_ENV. - Attr › SQLSetEnvAttr on that environment handle, to set ODBC version 3 (
SQL_OV_ODBC3). - Env › SQLAllocHandle, handle type
SQL_HANDLE_DBC. - Conn › SQLDriverConnect with the connection handle and your connection string, for example
DRIVER=IBM DB2 ODBC DRIVER;Database=MYRDB;HostName=myhost;Port=50000;UID=myuser;PWD=mypassword. If it fails, click Err (or Diag › Errors All) to see the error. - To run SQL statements, Env › SQLAllocHandle, handle type
SQL_HANDLE_STMT, with the connection handle.
Going further
These tools record more detail; Stelo Support may ask for their output:
tracert <host>, to see the route to the host.- A network capture tool such as Wireshark.
- ODBC tracing: the drivers bundled with SQDR have a Tracing tab in the ODBC Data Source Administrator, and can also use Progress DataDirect's Snoop utility to log the packets between the driver and the database.
- The IBM Db2 ODBC driver's
db2trcandddcstrc, the IBM i AccessCWBCOTRC, andTRCCNNon the IBM i. - For StarSQL, see DRDA tracing.
Change data notifications are not received¶
Symptom
Incremental groups pick up changes only at their Poll Interval, not right after the changes are committed.
Cause
The Capture Agent sends a UDP notification to the source's Notification Address when changes are committed (see Change data notifications). Notifications are turned off, sent to the wrong address, or blocked on the way.
What to do
In the Data Replicator Manager:
- On the source's Advanced tab, Notification Address must not be Disable (with Disable, the source's incremental groups only poll), and must be an address of the Replicator Service's computer that the Capture Agent can reach. Note the address.
- Check the group: a group with Use Fixed Schedule ignores notifications (see Group properties).
In the SQDR Control Center, on the Capture Agent's Configuration tab:
- Note udpPort and minimumNotificationDelay. Without them, the agent uses port 2728 and a delay of 5000 ms.
When Stelo Capture and Stelo Apply are on different computers:
- A firewall on the Stelo VM must allow outbound UDP from that port, and a firewall on the Replicator Service's computer must allow inbound UDP on it (see Ports).
- If the notifications pass through a VPN server, its own inbound and outbound rules can take precedence over the Windows Firewall: check the routing and remote access rules of the VPN interface.
"Bad IP address" when an incremental group starts¶
Symptom
An incremental group fails with:
Failed to enable Change Data Notification for incremental group 'MYGROUP'. Error: Bad IP address: N.N.N.N:2728
(Winsock bind returned error. System error 10049: The requested address is not valid in its context. )
Cause
The source's Notification Address is no longer an address of the Replicator Service's computer, typically because the computer got a new address from DHCP since the source was set up.
What to do
On the source's Advanced tab in the Data Replicator Manager, set Notification Address to a valid address of
this computer. Use a static address. When both parts of SQDR run on the same computer, use 127.0.0.1.
The new address takes effect for the source's incremental groups right away (see Change data notifications).
Connections time out on large transfers: black hole router¶
Symptoms
Often after a change in the network:
- A Capture Agent doesn't start. Its diagnostics show that the host was reached, and then the connection timed out.
- Other connections to the same system succeed, but time out when they fetch or send a lot of data.
-
This
pingtimes out, or rarely succeeds:ping -f -l 1472 <host>-l 1472sends the largest packet that fits a standard MTU of 1500 bytes, and-fforbids splitting it. On some networks, for example an IPsec VPN, the largest packet is somewhat smaller.
The same can affect connections to a destination, or between the Stelo VM.
Cause
A black hole router: a network segment on the path only carries smaller packets than the two computers use, and the router doesn't send the ICMP message that would tell them to use smaller packets, or a firewall on the path drops that message. Small packets get through; large ones disappear.
What to do
Ask your network administrator to fix the configuration of the path.
As a temporary workaround, lower the MTU on the computer that makes the connection:
- Find the largest packet size for which
ping -f -l <size> <host>succeeds, and add 28. For example, ifping -f -l 1400 <host>succeeds, the MTU is 1428. -
Show the interfaces and their MTU, then set it, in a command prompt run as administrator:
netsh interface ipv4 show subinterfaces netsh interface ipv4 set subinterface "Ethernet" mtu=1428Replace
Ethernetwith your interface's name.
The MTU affects all the computer's network traffic: use this only until the network is fixed. For the Stelo Replicator container, test and change the MTU on the Docker host, with that system's tools.