We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
github项目地址
wget https://github.com/kelseyhightower/confd/releases/download/v0.14.0/confd-0.14.0-linux-amd64
mkdir -p /opt/confd/bin mv confd-0.14.0-linux-amd64 /opt/confd/bin/confd chmod +x /opt/confd/bin/confd export PATH="$PATH:/opt/confd/bin"
mkdir -p /etc/confd/conf.d mkdir -p /etc/confd/templates
[template] src = "config.json.tmpl" dest = "/code/config/config.json" keys = [ "/mysql/host", "/mysql/port", ]
{ mysql:{ host:{{getv "/mysql/host"}}, port:{{getv "/mysql/port"}}, } }
confd -onetime -backend etcd -node http://127.0.0.1:2379
#!/bin/bash wget https://github.com/kelseyhightower/confd/releases/download/v0.14.0/confd-0.14.0-linux-amd64 mv confd-0.14.0-linux-amd64 /usr/bin/confd chmod +x /usr/bin/confd mkdir -p /etc/confd/conf.d mkdir -p /etc/confd/templates cat <<EOF | tee /etc/confd/conf.d/config.toml [template] src = "config.json.tmpl" dest = "/tmp/config.json" keys = [ "/mysql/host", "/mysql/port", ] reload_cmd = "echo 'reload' > /tmp/confd.log" EOF cat <<EOF | tee //etc/confd/templates/config.json.tmpl { mysql:{ host:{{getv "/mysql/host"}}, port:{{getv "/mysql/port"}}, } } EOF cat <<EOF | tee /etc/systemd/system/confd.service [Unit] Description=Confd Server After=network.target [Service] User=root Type=notify ExecStart=/usr/bin/etcd --watch -backend etcd -node http://127.0.0.1:2379 Restart=on-failure RestartSec=10s LimitNOFILE=40000 [Install] WantedBy=multi-user.target EOF etcdctl set /mysql/host 192.168.0.1 etcdctl set /mysql/port 8888 confd -onetime -backend etcd -node http://127.0.0.1:2379
The text was updated successfully, but these errors were encountered:
iliuyt
No branches or pull requests
GitHub项目地址
github项目地址
下载
创建目录
配置目录
添加模板配置
添加模板
通过etcd启动
脚本
The text was updated successfully, but these errors were encountered: