Commit Graph

33 Commits

Author SHA1 Message Date
James Nugent 3b1f523b85 cli: Add KV `export` and `import`
This commit adds two new commands to the Consul KV CLI, which export and
import a JSON formatted representation of the Consul KV tree. It is
useful to migrate parts of the KV tree between unrelated Consul
clusters, and could also be used for initial data population of the KV
store.
2017-01-05 07:57:38 -06:00
James Phillips 9003454f88 Adds basic build tag support with different versions. (#2463) 2016-11-02 17:27:49 -07:00
Kyle Havlovitz 440611f9f7 Add snapshot inspect subcommand (#2451) 2016-10-31 19:37:27 -04:00
James Phillips bc29610124 Adds support for snapshots and restores. (#2396)
* Updates Raft library to get new snapshot/restore API.

* Basic backup and restore working, but need some cleanup.

* Breaks out a snapshot module and adds a SHA256 integrity check.

* Adds snapshot ACL and fills in some missing comments.

* Require a consistent read for snapshots.

* Make sure snapshot works if ACLs aren't enabled.

* Adds a bit of package documentation.

* Returns an empty response from restore to avoid EOF errors.

* Adds API client support for snapshots.

* Makes internal file names match on-disk file snapshots.

* Adds DC and token coverage for snapshot API test.

* Adds missing documentation.

* Adds a unit test for the snapshot client endpoint.

* Moves the connection pool out of the client for easier testing.

* Fixes an incidental issue in the prepared query unit test.

I realized I had two servers in bootstrap mode so this wasn't a good setup.

* Adds a half close to the TCP stream and fixes panic on error.

* Adds client and endpoint tests for snapshots.

* Moves the pool back into the snapshot RPC client.

* Adds a TLS test and fixes half-closes for TLS connections.

* Tweaks some comments.

* Adds a low-level snapshot test.

This is independent of Consul so we can pull this out into a library
later if we want to.

* Cleans up snapshot and archive and completes archive tests.

* Sends a clear error for snapshot operations in dev mode.

Snapshots require the Raft snapshots to be readable, which isn't supported
in dev mode. Send a clear error instead of a deep-down Raft one.

* Adds docs for the snapshot endpoint.

* Adds a stale mode and index feedback for snapshot saves.

This gives folks a way to extract data even if the cluster has no
leader.

* Changes the internal format of a snapshot from zip to tgz.

* Pulls in Raft fix to cancel inflight before a restore.

* Pulls in new Raft restore interface.

* Adds metadata to snapshot saves and a verify function.

* Adds basic save and restore snapshot CLI commands.

* Gets rid of tarball extensions and adds restore message.

* Fixes an incidental bad link in the KV docs.

* Adds documentation for the snapshot CLI commands.

* Scuttle any request body when a snapshot is saved.

* Fixes archive unit test error message check.

* Allows for nil output writers in snapshot RPC handlers.

* Renames hash list Decode to DecodeAndVerify.

* Closes the client connection for snapshot ops.

* Lowers timeout for restore ops.

* Updates Raft vendor to get new Restore signature and integrates with Consul.

* Bounces the leader's internal state when we do a restore.
2016-10-25 19:20:24 -07:00
Seth Vargo ce5c820c4a
Add kv delete command 2016-09-26 16:06:53 -07:00
Seth Vargo d5dd8ef7a1
Add kv put command 2016-09-26 16:06:53 -07:00
Seth Vargo a8dc0f86b6
Add kv get 2016-09-26 16:06:53 -07:00
Seth Vargo cd8ac28a87
Add kv command stubs 2016-09-26 16:06:53 -07:00
James Phillips 1b7a16b7d3
Adds new consul operator endpoint, CLI, and ACL and some basic Raft commands. 2016-08-30 00:02:50 -07:00
James Phillips 9816c995bd Adds version info back into the config.
In #2191 I accedentally broke SCADA by not populating the agent's version
information into the config structure. This adds it back, and makes the
distinction between the raw parts we send to APIs and the human form of
the version that we display.
2016-07-19 18:38:15 -07:00
James Phillips 53877aa260 Makes sure version is always displayed consistently. 2016-07-19 15:06:32 -07:00
James Phillips b9732e3c39 Gives RTT class a more Go-like name. 2015-10-23 15:23:01 -07:00
James Phillips 43df5c6784 Adds a "consul rtt" command. 2015-10-23 15:23:01 -07:00
Joseph Anthony Pasquale Holsten ae3e8d24c4 command/configtest: add 2015-05-08 13:09:50 -07:00
Michael S. Fischer 4200a3d04a Handle SIGTERM when running commands
Make Consul treat SIGTERM like it does SIGINT when running commands.
This is especially important when running Consul as a daemon, since
Unix process managers send SIGTERM to restart or terminate a process.

This change is untested on Windows.

Fixes hashicorp/consul#797
2015-03-30 15:32:58 -07:00
Ryan Uber 515ef304e0 command: starting maint command 2015-01-21 13:00:14 -08:00
Armon Dadgar 6fcc743384 Adding new command 'lock' 2015-01-19 14:37:58 -10:00
Armon Dadgar 61eb2da69d Only override version pre-release if blank 2014-11-24 11:05:11 -08:00
Armon Dadgar 52f68c528f Merge pull request #494 from epankala/version
Update to 'consul version' behaviour
2014-11-24 11:03:00 -08:00
Janne Paenkaelae b733df334b Update to 'consul version' behaviour
After e6b6f181728b88c2e430fc7ad71fe1f84db3418c if consul was built
with just running "go build" the GitDescribe would be empty and consul
version would be empty.

This change alters the behaviour so that if consul is build without
proper ldflags the version will be postfixed with "dev" prerelease to
indicate that it is self compiled in a wrong way.

Should someone have a bug in such a binary at least devs should easily
see from the version number that binary has not been created by
recommended means.
2014-11-23 15:42:08 +00:00
Dan Sosedoff 6cb25cf573 Fix comment for commands map 2014-11-22 11:44:23 -06:00
Ryan Uber 8dc53447a3 command: renamed keys to keyring to disambiguate usage 2014-11-19 16:31:06 -08:00
Ryan Uber f25c2c1f06 command: add skeletons for keys command 2014-11-19 16:30:21 -08:00
Janne Paenkaelae e15262c8b7 Make the 'consul version' to return value that is from 'git describe --tags' 2014-11-18 22:15:58 +00:00
Armon Dadgar 233636dc94 command/exec: First pass at exec command 2014-09-01 14:46:21 -07:00
Armon Dadgar c982301b07 command/event: Adding new event command 2014-08-28 16:40:31 -07:00
Armon Dadgar 1b88eb4d98 command/watch: First pass at command 2014-08-21 16:02:41 -07:00
Armon Dadgar 7b6adb91bd command/reload: Adding new command 2014-06-11 10:58:26 -07:00
Armon Dadgar 39cdecb5d0 agent: Add version to info output 2014-06-06 14:40:22 -07:00
Armon Dadgar 883f492dc5 command/info: Adding new info command 2014-02-23 16:59:32 -08:00
Armon Dadgar 5d3a3e41fe Adding the various CLI commands 2013-12-31 13:06:33 -08:00
Armon Dadgar cb659a3b77 Adding agent skeleton 2013-12-19 12:18:06 -08:00
Armon Dadgar 5aa94a7989 Adding basic CLI infrastructure 2013-12-19 11:22:08 -08:00