-
-
Save robertkraig-bambee/2aeaed388144c9b5e572c0de28e8b964 to your computer and use it in GitHub Desktop.
Contains cheetsheet for consul
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1) Start consul cluster - | |
| # consul agent -server -bootstrap-expect=1 -data-dir=consul-data -ui -bind=127.0.0.1 | |
| 2) put key-values | |
| # consul kv put config/key value | |
| 3) get key-values - | |
| # consul kv get config/key | |
| 4) get keys from consul with host and acl-token(Your own hosted consul) - | |
| # consul kv get -http-addr=my.consul.test.com -token=0000-0000-0000-00000 config/key | |
| 4) export key-values(Will export from config path) - | |
| # consul kv export config | |
| 5) export key-values from root path - | |
| # consul kv export | |
| 6) export key-values to json file - | |
| # consul kv export config >export.json | |
| 7) import key-values - | |
| # consul kv import @import.json | |
| 8) Example json file format of consul to import/export - | |
| Example json file - | |
| [ | |
| { | |
| "key": "config" | |
| "flags": 0, | |
| "value": "aGVsbG8=" | |
| } | |
| ] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment