da.Fill(ds);
dt = ds.Tables[0];
foreach (DataRow row in dt.Rows)
{
Console.WriteLine(row["table_catalog"] + ", " +
row["table_name"]);
}
conn.Close();
Console.ReadKey();
}
catch (Exception ex)
{
Console.Error.WriteLine(ex.Message);
Console.ReadKey();
}
}
}
}
Connect from Outside of Amazon EC2 - Firewall
Timeout Issue
When you are connecting to Amazon Redshift from a computer other than an Amazon Elastic Compute
Cloud (Amazon EC2) instance, idle connections may be terminated by an intermediate network component,
such as a firewall after a period of inactivity. This behavior is typical when you log in from a Virtual Private
Network (VPN) or your local network.To avoid these timeouts, we recommend the following changes to
your local configuration:
• Increase client system values that deal with TCP/IP timeouts.You should make these changes on the
computer you are using to connect to your cluster.The timeout period should be adjusted for your client
and network. See the To change TCP/IP timeout settings (p. 112)
• Set the TCP/IP keep-alive behavior for you client by specifying an additional connection parameter.
See the To specify the TCP/IP keep alive setting in a connection string (p. 113) procedure.
To change TCP/IP timeout settings
1. Configure the timeout settings according to the operating system that you use to connect to your
cluster.
a. Linux — If you client is running on Linux, run the following command as the root user.
/sbin/sysctl -w net.ipv4.tcp_keepalive_time=200
net.ipv4.tcp_keepalive_intvl=200 net.ipv4.tcp_keepalive_probes=5
b. Windows — If your client is running on Windows, make the following changes to your registry
settings.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Paramet
ers\KeepAliveTime 30000
API Version 2012-12-01
112
Amazon Redshift Management Guide
Connect from Outside of Amazon EC2 - Firewall Timeout
Issue