{{ $clusters := tree "DB/MYSQL/CLUSTERS" | byKey }} {{ range $cluster, $pairs := $clusters }}###################################{{$cluster}}#######################################{{ with $cluster_id := key (printf "DB/MYSQL/CLUSTERS/%s/CLUSTER_ID" $cluster) | parseInt }} {{ $dcs := tree ( printf "DB/MYSQL/CLUSTERS/%s/DCS/" $cluster)| byKey }}{{ range $dc, $pairs := $dcs }}## {{ $dc }} ##{{ $slaves:= tree (printf "DB/MYSQL/CLUSTERS/%s/DCS/%s/SLAVES/" $cluster $dc ) | byKey}}{{ range $slave, $pairs_slaves := $slaves }}{{ $slave := (print $slave ) | toLower }}REPLACE into mysql_servers (hostgroup_id,hostname) values ({{$cluster_id}}, '{{$slave}}'); {{end}}{{end}}{{ $cluster_lower := (print $cluster ) | toLower }}REPLACE into mysql_replication_hostgroups values({{$cluster_id}},{{ add $cluster_id 1000 }},{{(printf "'mysql_%s'" $cluster_lower)}});{{end}}{{end}}
## LOAD CHANGES TO MEM AND TO DISK ##load mysql servers to runtime;save mysql servers to disk;2017/07/10 19:20:26.043522 [WARN] (runner) watching 216 dependencies - watching this many dependencies could DDoS your consul cluster--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/hashicorp/consul/issues
IRC: #consul on Freenode
---
You received this message because you are subscribed to the Google Groups "Consul" group.
To unsubscribe from this group and stop receiving emails from it, send an email to consul-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/consul-tool/8f0bf9a7-eae2-4b18-834e-35ec87050ee5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
{{ $clusters := tree "DB/MYSQL/CLUSTERS" | explode }} {{ range $cluster, $cluster_pair := $clusters }}###################################{{$cluster}}#######################################{{ with $cluster_id := (print $cluster_pair.CLUSTER_ID ) | parseInt }} {{ range $dc, $dc_pair := $cluster_pair.DCS}}## {{ $dc }} ##{{ range $slave, $slave_pair := $dc_pair.SLAVES }}{{ $slave := (print $slave ) | toLower }}REPLACE into mysql_servers (hostgroup_id,hostname) values ({{$cluster_id}}, '{{$slave}}'); {{end}}{{end}}{{ $cluster_lower := (print $cluster ) | toLower }}## LOAD CHANGES TO MEM AND TO DISK ##REPLACE into mysql_replication_hostgroups values({{$cluster_id}},{{ add $cluster_id 1000 }},{{(printf "'mysql_%s'" $cluster_lower)}});{{end}}{{end}}load mysql servers to runtime;save mysql servers to disk;To view this discussion on the web visit https://groups.google.com/d/msgid/consul-tool/8aa84a75-c561-431c-b649-17b6d08af7a5%40googlegroups.com.