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

Limit cluster to 3 nodes #2905

Merged
merged 1 commit into from
Jun 11, 2015

Conversation

benbjohnson
Copy link
Contributor

Overview

This pull request restricts the maximum number of nodes in a cluster to 3.

Fixes #2750

@@ -129,6 +129,12 @@ func (s *Store) IDPath() string { return filepath.Join(s.path, "id") }

// Open opens and initializes the raft store.
func (s *Store) Open() error {
// Verify that no more than 3 peers.
// https://github.com/influxdb/influxdb/issues/2750
if len(s.peers) > 3 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When is s.peers increased? When does it hit 4?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I mean is that for this to work, peers must include the guy who is joining, correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Peers are hardcoded in the configuration file. All nodes need to have the same set of peers so there's not really a sense of "joining" anymore. If you start the first server up and you list 4 peers then it'll immediately fail.

@pauldix
Copy link
Member

pauldix commented Jun 11, 2015

Does this actually stop it from joining or does it just error the server out if they've joined more than 3 to the raft cluster?

@benbjohnson
Copy link
Contributor Author

@pauldix You have to specify all peers in the config file so it will fail immediately even when the first node tries to start up.

This commit restricts the maximum number of nodes in a cluster to 3.

Fixes influxdata#2750
@pauldix
Copy link
Member

pauldix commented Jun 11, 2015

@benbjohnson ugh, that's really ugly. I guess this means a bunch of work needs to be done in 0.9.1 to add joining a cluster back in as a concept?

The config file thing won't work in the real world. Otherwise how are new nodes going to join a cluster?

@benbjohnson
Copy link
Contributor Author

@pauldix I don't think it'll be a bunch of work. We still need the initial peer set so that nodes can wait for a quorum before creating the initial cluster.

@pauldix
Copy link
Member

pauldix commented Jun 11, 2015

@benbjohnson cool, I just want to make sure that when we add that in, people running an 0.9.0 cluster will be able to upgrade without breaking config files or anything like that.

benbjohnson added a commit that referenced this pull request Jun 11, 2015
@benbjohnson benbjohnson merged commit ed4d009 into influxdata:master Jun 11, 2015
@benbjohnson benbjohnson deleted the limit-cluster-size branch August 13, 2015 20:05
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

Successfully merging this pull request may close these issues.

None yet

3 participants