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

Support "exec" in foreign datacenters #584

Merged
merged 3 commits into from Jan 7, 2015
Merged

Support "exec" in foreign datacenters #584

merged 3 commits into from Jan 7, 2015

Conversation

armon
Copy link
Member

@armon armon commented Jan 7, 2015

Previously it was possible to specify a datacenter with -datacenter but setting anything other than the local datacenter would fail. This PR properly handles remote data centers. In a local datacenter, we associate a session with the node that is invoking exec. In a remote datacenter, we associated a session with a Consul server in the remote datacenter. Additionally, we make use of the new SessionDelete behavior to ensure garbage is cleaned up, and a session TTL for cases where we fail to explicitly destroy a session. Fixes #313

armon added a commit that referenced this pull request Jan 7, 2015
Support "exec" in foreign datacenters
@armon armon merged commit 74de4d6 into master Jan 7, 2015
@armon armon deleted the f-exec-dc branch January 7, 2015 22:29
@keithchambers
Copy link

Just hit this. Thanks for fixing Armon!

In case somebody plugs the error message in to Google ... this is what it looks like:

[centos@dc1-host1 ~]$ consul consul exec -datacenter="dc1" whoami
dc1-host1: root
dc1-host1:
==> dc1-host1: finished with exit code 0
1 / 1 node(s) completed / acknowledged

[centos@dc1-host1 ~]$ consul consul exec -datacenter="dc2" whoami
Failed to create session: Unexpected response code: 500 (rpc error: rpc error: Missing node registration)

duckhan pushed a commit to duckhan/consul that referenced this pull request Oct 24, 2021
* Update CONTRIBUTING.md with new acceptance tests info

* Fix race condition in terraform templates
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.

Support exec in foreign datacenter
2 participants