Skip to content
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

Multiple Memberlists on a single machine #6

Closed
carterventures opened this issue Nov 29, 2013 · 4 comments
Closed

Multiple Memberlists on a single machine #6

carterventures opened this issue Nov 29, 2013 · 4 comments

Comments

@carterventures
Copy link

I apologize if I'm having a total brain fart here (stemming from either a Thanksgiving food coma or the fact that this is my first foray into go), but I'm attempting to launch two instances of a service using the Memberlist library on my local machine, using separate ports for Memberlist, but am hitting an error:

[ERR] Conflicting address for mbp-chrisc-lt. Mine: 192.168.206.249:8001 Theirs: 192.168.206.249:8002

Based on the block below (line 586) in the state.go file, it appears as though this configuration may not be supported by Memberlist:

 // Check if this address is different than the existing node
 if !reflect.DeepEqual([]byte(state.Addr), a.Addr) || state.Port != a.Port {
        m.logger.Printf("[ERR] Conflicting address for %s. Mine: %v:%d Theirs: %v:%d",
                        state.Name, state.Addr, state.Port, net.IP(a.Addr), a.Port)
        return
}

If I read that right, it will print that error and return if the two addresses are NOT the same OR the ports are NOT the same. Should it be the other way around?

@armon
Copy link
Member

armon commented Nov 29, 2013

It is a bit confusing. Basically Memberlist requires that the mapping of node Name -> (Addr, Port) being unique. So it means you cannot have two nodes with the same name. Technically the (Addr, Port) tuple should also be unique but I don't think it generates an error for that. The problem is that both of your Memberlist nodes are advertising using the same name (which defaults to the hostname). All you need to do is provide a unique Name inside the Config object.

@armon
Copy link
Member

armon commented Nov 29, 2013

You are probably calling DefaultConfig() which set's the name for you: https://github.com/hashicorp/memberlist/blob/master/memberlist.go#L185

@carterventures
Copy link
Author

Ahh, that did it, thanks! After making the change to use a unique name, it's working just fine. Appreciate the quick response. Do you guys prefer questions like this to go to say, the Serf user group, or do issues on Github suffice?

@armon
Copy link
Member

armon commented Nov 29, 2013

Issues on Github are fine. But if you prefer the user group, that works too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants