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 member to cluster by dns recovery #8585

Closed
zyf0330 opened this issue Sep 21, 2017 · 9 comments
Closed

add member to cluster by dns recovery #8585

zyf0330 opened this issue Sep 21, 2017 · 9 comments

Comments

@zyf0330
Copy link

zyf0330 commented Sep 21, 2017

I want to know if I can add member to a running cluster by dns recovery way ?

@gyuho
Copy link
Contributor

gyuho commented Sep 21, 2017

See https://github.com/coreos/etcd/blob/master/Documentation/op-guide/runtime-reconf-design.md#do-not-use-public-discovery-service-for-runtime-reconfiguration.

The public discovery service should only be used for bootstrapping a cluster. To join member into an existing cluster, use runtime reconfiguration API.

@xiang90
Copy link
Contributor

xiang90 commented Sep 21, 2017

closing because of @gyuho's reply.

@xiang90 xiang90 closed this as completed Sep 21, 2017
@zyf0330
Copy link
Author

zyf0330 commented Sep 22, 2017

Just confirm. Thanks.

@zyf0330
Copy link
Author

zyf0330 commented Sep 25, 2017

When I add a member, After getting config from etcdctl member add, could I change
ETCD_INITIAL_CLUSTER option into dns recovery option?

@gyuho
Copy link
Contributor

gyuho commented Sep 25, 2017

When I add a member, After getting config from etcdctl member add, could I change
ETCD_INITIAL_CLUSTER option into dns recovery option?

Can you explain more of your use case?

@zyf0330
Copy link
Author

zyf0330 commented Sep 25, 2017

In the doc example, etcdctl member add gives this

added member 9bf1b35fc7761a23 to cluster

ETCD_NAME="infra3"
ETCD_INITIAL_CLUSTER="infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380,infra3=http://10.0.1.13:2380"
ETCD_INITIAL_CLUSTER_STATE=existing

And ETCD_INITIAL_CLUSTER option specifies static way to find cluster. So I think I can replace this option with --discovery-srv example.com, so the way becomes DNS discovery. I have not tried it, but a colleague tell me that he succeeded.

@gyuho
Copy link
Contributor

gyuho commented Sep 25, 2017

With ETCD_INITIAL_CLUSTER, yes. Discovery is only for initial bootstrap.

@zyf0330
Copy link
Author

zyf0330 commented Sep 26, 2017

I remove a member from three-member cluster, then try to add a member.
When I use ETCD_INITIAL_CLUSTER, everything is normal.

Then I try dns discovery. The reason that I remove a member from three-member cluster and re-add it, is that I don't need to change dns srv records.
This is what I got when try to add member.

2017-09-26 09:54:09.622563 I | etcdmain: Go OS/Arch: linux/amd64
2017-09-26 09:54:09.622571 I | etcdmain: setting maximum number of CPUs to 4, total number of available CPUs is 4
2017-09-26 09:54:09.622678 I | embed: listening for peers on http://127.0.0.1:2380
2017-09-26 09:54:09.622748 I | embed: listening for client requests on 127.0.0.1:2379
2017-09-26 09:54:09.884646 N | embed: got bootstrap from DNS for etcd-server at node03=https://node03.example.com:2380
2017-09-26 09:54:09.884809 N | embed: got bootstrap from DNS for etcd-server at 0=https://node01.example.com:2380
2017-09-26 09:54:09.884823 N | embed: got bootstrap from DNS for etcd-server at 1=https://node02.example.com:2380
2017-09-26 09:54:10.017366 W | etcdserver: could not get cluster response from https://node01.example.com:2380: Get https://node01.example.com:2380/members: x509: certificate is valid for node01.example.com, not example.com
2017-09-26 09:54:10.073606 W | etcdserver: could not get cluster response from https://node02.example.com:2380: Get https://node02.example.com:2380/members: x509: certificate is valid for node02.example.com, not example.com
2017-09-26 09:54:10.074702 C | etcdmain: cannot fetch cluster info from peer urls: could not retrieve cluster information from the given urls

The problem about https has been issued in #8445 and is being fixed. And there is another problem here

2017-09-26 09:54:09.884809 N | embed: got bootstrap from DNS for etcd-server at 0=https://node01.example.com:2380
2017-09-26 09:54:09.884823 N | embed: got bootstrap from DNS for etcd-server at 1=https://node02.example.com:2380

It shows 0 and 1 not node01 and node02 as name, maybe it is index of array and I don't know whether it affects.
@gyuho

@zyf0330
Copy link
Author

zyf0330 commented Nov 15, 2017

After read source code, I know that 0 and 1 are just temp name and after get cluster response while DNS Discovery process they will be right. So this is duplicate issue of #8445.

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

No branches or pull requests

3 participants