Closed vTNT closed 6 years ago
redis:
- host: 1
- k: 2
did it support this format?
i found that this format is fine:
redis:
host: 1
password: 2
port: 3
No, as Consul is a simple key/value store - how would you expect your earlier examples to be represented in Consul?
ok, did you store redis/mysql configuration in consul? I'm currently trying to put redis/mysql configuration in Consul;
You can put any config you like in there, so long as it can be represented as keys with values - and internally Consul only supports string values. This works:
foo:
abc: 1
def: x
This works:
foo:
bar:
abc: 1
def: y
xyz:
abc: 1
def: z
This also works:
foo:
bar: 1
servers:
- server1
- server2
- server3
In this special case the "servers:" array will be joined into a string within consul (default glue=\n) , so you'd need to split it when you read the value back out.
got it, i will try it again, thank you ^ ^
my yaml file:
i run this command:
but the result is Error: Invalid type map[string]interface {} in array. Only strings, numbers and boolean values are supported. did it support this format?