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

add join support #215

Closed
siddontang opened this issue Jul 26, 2016 · 8 comments
Closed

add join support #215

siddontang opened this issue Jul 26, 2016 · 8 comments
Assignees
Milestone

Comments

@siddontang
Copy link
Contributor

siddontang commented Jul 26, 2016

Now adding a member dynamically is not easy, see https://coreos.com/etcd/docs/latest/runtime-configuration.html
And we have to another supply initital_cluster_state flag too, I think we can use another way to do it.

# start first pd
pd-server -name pd1 -host pd1

# start second pd and join the cluster
pd-server -name pd2 -host pd2 -join "pd1=http://pd1:2379"

# start third pd and joint the cluster
pd-server -name pd3 -host pd3 -join "pd1=http://pd1:2379"
# or
pd-server -name pd3 -host pd3 -join "pd2=http://pd2:2379"
# or
pd-server -name pd3 -host pd3 -join "pd1=http://pd1:2379,pd2=http://pd2:2379"

We start first pd and then use join mechanism to let following pd to join the cluster. The join arg can contain any valid pds in current cluster

/cc @disksing @qiuyesuifeng @iamxy

@siddontang siddontang changed the title remove initial_cluster_state and handle add member automatically. use join instead of origin initial_cluster Jul 26, 2016
@c4pt0r
Copy link
Contributor

c4pt0r commented Jul 26, 2016

@overvenus PTAL

@c4pt0r
Copy link
Contributor

c4pt0r commented Jul 26, 2016

Feel free to ask @siddontang if u have any question. @overvenus

@c4pt0r c4pt0r added this to the beta 2 milestone Jul 26, 2016
@overvenus
Copy link
Member

Got it!

@siddontang
Copy link
Contributor Author

you must notice that the join pd list must be pd:2379, not 2380, because 2380 is for internal peer communication, but here we need let pd to add us in cluster

@xiang90
Copy link

xiang90 commented Jul 27, 2016

This is pretty dangerous. For etcd, we intentionally make it tedious by requiring two steps + full expected configuration... Or people will make mistakes and screw up their clusters (we use join in the early version of etcd... we see too many troubles...).

@ngaut
Copy link
Member

ngaut commented Jul 28, 2016

Thank you. @xiang90

@siddontang
Copy link
Contributor Author

Hi @xiang90

We also use two-step in join, it is the same as etcd add member doc says. First sending Add member request to etcd, then start new member again with corresponding args.

Of course, this may be still dangerous even we add enough check.

@c4pt0r

@siddontang siddontang changed the title use join instead of origin initial_cluster add join support Jul 29, 2016
@siddontang siddontang modified the milestone: beta3 Jul 30, 2016
@overvenus
Copy link
Member

Fixed, #226

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