-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve handling when not all loopback addresses are available #461
Conversation
@@ -314,6 +315,15 @@ def start(self, no_wait=False, verbose=False, wait_for_binary_proto=False, | |||
|
|||
common.assert_jdk_valid_for_cassandra_version(self.cassandra_version()) | |||
|
|||
# check whether all loopback aliases are available before starting any nodes | |||
for node in list(self.nodes.values()): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think building a list, here or in the line below, is necessary.
Other than my little nit about building |
@mambocab thanks - I've updated to remove those extra list() and improved the error message a bit; I'll squash after reviews |
if itf is not None: | ||
if not common.check_socket_available(itf, return_on_error=True): | ||
addr, port = itf | ||
print "Inet address %s:%s is not available; a cluster may already be running or you may need to add the loopback alias" % (addr, port) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will need to from six import print_
, and then use the print_
function here, to maintain compatibility across python 2 and 3.
+1 after the Python2/3 compat fix. |
On Mac the user needs to make sure the loopback addresses (127.0.0.2, 127.0.0.3, etc.) are created. Currently if they aren't created, ccm fails when creating the cluster, but leaves it in a partial state (usually just the first node is running). This change does a pre-flight check to make sure all loopbacks are available, print a better warning, and exit before starting any nodes.
Review comments addressed and commits squashed - should be ready to go |
Improve handling when not all loopback addresses are available
On Mac the user needs to make sure the loopback addresses (127.0.0.2, 127.0.0.3, etc.)
are created. Currently if they aren't created, ccm fails when creating the cluster,
but leaves it in a partial state (usually just the first node is running).
This change does a pre-flight check to make sure all loopbacks are available, print
a better warning, and exit before starting any nodes.