Got help from the experts. The connectTimeout has nothing to do with this. I edited the previous post.
The reason for the timeout is likely that you got a TCP socket connect timeout.
On a mac this is usually set to 75s. Maybe you have a firewall blocking the slave?
To view the timeout value on a Mac:
$ sysctl net.inet.tcp.keepinit
net.inet.tcp.keepinit: 75000
Linux:
# cat /proc/sys/net/ipv4/tcp_syn_retries
6
To change the timeout on a Mac:
$ sudo sysctl net.inet.tcp.keepinit=10000
Which gives a connect timeout ceiling of 10 seconds.
Linux:
$ echo 7 > /proc/sys/net/ipv4/tcp_syn_retries
Here 6 gives an effective connect timeout ceiling of around 45 seconds, 7 gives around 90 seconds, and 8 gives around 190 seconds.