Comments (9)
@sethvargo I was wondering if you have looked into this. I can start working on this and send you a PR if you are busy
from consul-replicate.
@cleung2010 thank you for opening an issue.
The JSON you supplied is not a direct translation from the HCL. Top-level keys in HCL are actually keys to arrays of objects in JSON, i.e.:
consul = "127.0.0.1:8500"
token = "abcd1234"
retry = "10s"
max_stale = "10m"
auth {
enabled = true
username = "test"
password = "test"
}
becomes:
{
"auth": [
{
"enabled": true,
"password": "test",
"username": "test"
}
]
}
Are you experiencing issues when you specify the prefixes as an array of objects, because that should definitely work?
from consul-replicate.
So I am not using HCL at all as my config file. I want to use multi-prefix via JSON. The readme says I can do it like so in HCL:
prefix {
source = "global@nyc1"
destination = "local/nyc1"
}
prefix {
source = "global@nyc2"
destination = "local/nyc2"
}
But how can I do this in JSON since keys need to be unique (thus two prefix
wouldn't work)?
from consul-replicate.
@cleung2010 the same as my example for auth (and the example you provided yourself above):
{
"prefix": [
{
"source": "...",
"destination": "..."
}
]
}
from consul-replicate.
Oh nice, and I assume the same would apply for destination
. I am going to go ahead and close the issue, thanks for clearing this up! It wouldn't hurt to provide a JSON example on the readme for people less familiar with explicit translations done by HCL :)
from consul-replicate.
@cleung2010 no, destination must be a string. It's the same as the command line. If you want multiple destinations, you need to specify the prefix multiple times.
from consul-replicate.
So
{
"prefix": [
{
"destination": "local/nyc1",
"source": "global@nyc1"
},
{
"destination": "local/nyc2",
"source": "global@nyc2"
},
{
"destination": "temp/nyc2",
"source": "global@nyc2"
}
]
}
Instead of
{
"prefix": [
{
"destination": "local/nyc1",
"source": "global@nyc1"
},
{
"destination": [
"local/nyc2",
"temp/nyc2"
],
"source": "global@nyc2"
}
]
}
from consul-replicate.
Yes
from consul-replicate.
Cool, thanks!
from consul-replicate.
Related Issues (20)
- Project status?
- Replication stops working for a particular k/v secrets
- Photo editing
- photo
- support streaming backend
- consul-replicate sync empty data during raft leader election in the master DC HOT 8
- why not add feature for registering consul ? we need to watch whether consul-replicate is running
- The status_dir configuration appears to be ignored when read from file HOT 2
- This service requires some kind of basic HTTP health check
- Is consul-replicate compatible with consul-esm?
- Consul replicate mandates wan links
- No way to force HTTP HOT 2
- Unexpected response code: 500 HOT 2
- Consul Connect Intentions replication using consul-replicate HOT 5
- vault + consul cross DC setup HOT 1
- safeService
- TLS 1.3 support
- How To replicate multiple Dcs
- performance degrades as watched prefix becomes heavier
- consul-replicate overwrites keys with the same prefix in the destination data center as the source HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from consul-replicate.