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

Document a procedure for renaming DCs #1858

Closed
slackpad opened this issue Mar 21, 2016 · 8 comments
Closed

Document a procedure for renaming DCs #1858

slackpad opened this issue Mar 21, 2016 · 8 comments
Labels
type/docs Documentation needs to be created/updated/clarified
Milestone

Comments

@slackpad
Copy link
Contributor

Carry over from here - https://groups.google.com/d/msgid/consul-tool/b80a40ef-6b02-47d2-9bee-3014135ade22%40googlegroups.com?utm_medium=email&utm_source=footer. We should document some steps to do this.

@slackpad slackpad added the type/docs Documentation needs to be created/updated/clarified label Mar 21, 2016
@jeffbyrnes
Copy link

Is there any way to change the datacenter name & not lose what’s stored in Consul’s K/V store? Specifically, I have Vault using Consul as its backing store, and I need to change the datacenter name.

@danlsgiga
Copy link

Same here... tried changing the datacenter name and completely lost access to the cluster. I have couple ACLs and even the master token was not working at all. Had to revert the name back to regain access.

@gvenka008c
Copy link

gvenka008c commented Feb 9, 2017

@slackpad @here I got into the same issue. Renamed the datacenter name and restarted the service. But lost access to the cluster. What would be the best steps we can follow to rename the datacenter name without affecting the running cluster?

@c4milo
Copy link
Contributor

c4milo commented Dec 13, 2017

@slackpad, any update on this issue? Is https://www.consul.io/docs/guides/autopilot.html#upgrade-migrations close to what we will have to do in order to not lose the whole cluster?

@slackpad slackpad added this to the Unplanned milestone Jan 5, 2018
@guidoiaquinti
Copy link
Contributor

guidoiaquinti commented May 3, 2018

What about providing an abstraction layer that can be used to rename the datacenter name at runtime? I might be oversimplifying but to change the datacenter name from A to B without downtime we could do something like:

  1. execute consul datacenter --alias A B
  2. change is propagated to the servers in the RAFT ring and the command is returned. From now on, all catalog/KV queries with dc=A are transparently renamed on the fly to dc=B
  3. modify the agent configuration on all the clients to register to cluster B + service restart. All the clients are now registered using the new name
  4. modify the agent configuration on all the servers to register as cluster B. All the nodes in the cluster are now registered using the new name
  5. we verify that there aren't anymore queries to dc=A
  6. we drop the alias

@joewilliams
Copy link

@guidoiaquinti's procedure looks awesome and would work great for our use case as well.

@hanshasselberg
Copy link
Member

This is nothing that we have time to actively work on. There is however a similar mechanism to switch domains with alt-domain, just throwing it out there. If you want to provide a PR I would be happy to look at it and give feedback.

@nahsi
Copy link

nahsi commented Jan 31, 2022

For anyone interested, I found out that renaming datacenter in configuration and restarting ALL consul agents (including servers) at the same time just works. Catalog is working, vault and other k/v data is there.

I've tested without TLS and ACL though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/docs Documentation needs to be created/updated/clarified
Projects
None yet
Development

No branches or pull requests

9 participants