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

Question: Roles of nodes in memberlist #46

Open
diptanu opened this issue Aug 2, 2015 · 7 comments
Open

Question: Roles of nodes in memberlist #46

diptanu opened this issue Aug 2, 2015 · 7 comments

Comments

@diptanu
Copy link

diptanu commented Aug 2, 2015

Hi @armon and @mitchellh ,

Do you think it would be possible to designate role or additional metadata regarding a node when it joins a cluster? I understand that it's currently not possible but would be interested in a PR which would allow a user to configure the role of a node and query memberlist for nodes with specific metadata?

We are currently using the name field and adding more information to the name and parse the names to decipher the roles of various nodes in a cluster.

@armon
Copy link
Member

armon commented Aug 4, 2015

@diptanu You can! You want to use the NodeMeta to associate metadata with the node (https://github.com/hashicorp/memberlist/blob/master/delegate.go#L10). We use this in Serf to support Key/Value tags. The queries can be done locally since the nodes have the full member list with all the meta data. In most cases, you are better off using the Serf library instead of Memberlist directly as it implements a ton of both nice and necessary (partition recovery) features.

@armon
Copy link
Member

armon commented Aug 4, 2015

Serf is confusingly both a CLI based agent, but also just a drop in library. Consul embeds the Serf library for example for all gossip related features.

@diptanu
Copy link
Author

diptanu commented Aug 5, 2015

@armon Thanks a ton! This library is awesome :) Also, are you suggesting to use serf as a library instead of memberlist?

Also, I need to put raft on top of serf like you guys do in Consul, however I need to do multiple smaller concensus groups within a cluster instead of a single concensus group.

@armon
Copy link
Member

armon commented Aug 5, 2015

@diptanu Yeah the Serf library is both easier to use and has a ton more features. This library was meant to be almost purely an implementation of the SWIM algorithm, but many of the bells and whistles needed for the real world are in Serf. Sounds like you are working on something interesting, I'd love to learn more :)

@kyleterry
Copy link

Given you recommend using Serf as a library, are there any docs on doing that? I've been looking at the Consul code to see how this is done, and that gets me pretty far, but it's a lot of context switching.

Thanks for both of these things!

@JensRantil
Copy link

@kyleterry How about opening an issue with the Serf project/repo instead?

@kyleterry @armon I suggest this issue can be closed.

@longquanzheng
Copy link

@diptanu You can! You want to use the NodeMeta to associate metadata with the node (https://github.com/hashicorp/memberlist/blob/master/delegate.go#L10). We use this in Serf to support Key/Value tags. The queries can be done locally since the nodes have the full member list with all the meta data. In most cases, you are better off using the Serf library instead of Memberlist directly as it implements a ton of both nice and necessary (partition recovery) features.

Just curious, why does serf depend on memberlist?

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

5 participants