下载安装confd
$ mkdir -p $GOPATH/src/github.com/kelseyhightower
$ git clone https://github.com/kelseyhightower/confd.git $GOPATH/src/github.com/kelseyhightower/confd
$ cd $GOPATH/src/github.com/kelseyhightower/confd
$ ./build
root@ubuntu:~# confd -version
confd 0.12.0-dev
配置文件
confd支持一下数据库作为后端
- etcd
- consul
- vault
- environment variables
- redis
- zookeeper
- dynamodb
- stackengine
- rancher
vim /etc/confd.conf backend = "etcd"
log-level = "info"
interval = 10
nodes = [
"http://configuration.downtown8.cn:2379",
]