1. Prerequisites
- SSH access to one of your Consul server nodes
- Consul UI open in your browser (defaults to http://127.0.0.1:8500/ui)
2. Adding Data via the CLI
Use theconsul kv put command to insert entries under the apps/eCommerce prefix.
3. Deleting an Entry
If you need to remove a key, useconsul kv delete. For example, to delete the connection string:
4. Adding Data for the Search Service
Next, create configuration entries for a hypothetical search service:If you don’t see the new entries right away, click the Refresh button in the UI or clear your browser cache.
5. Querying Data in the CLI
Retrieve a value directly from the CLI:6. Querying Data via the HTTP API
Consul’s HTTP API returns values in Base64. First, inspect the raw JSON:Any application using Consul’s K/V HTTP API must Base64-decode the
Value field before use.