Make the the number of ports to scan when trying to join a cluster
configurable, and set the default to 2.

Closes #7090