Code Monkey home page Code Monkey logo

confd's Introduction

confd

confd是一个统一配置管理工具,目前仍在开发中,基于本地文件存储的部署方式已经可以用于生产环境中。

Features
  • 基础解析:配置文件使用toml格式,模板数据分离
  • 多种存储支持:local file、redis、zookeeper
  • 两种运行模式:Debug或Daemon
  • cli工具:修改store,批量更新配置
  • 更友好的交互方式,比如通过web界面
  • 分离server和client,提供客户端cli或API供拉取指定配置
  • 加密支持:store中存储的配置可加密,防止泄露
Usage

安装

#假设安装路径为/data/server/confd
#go get获取依赖的第三方库 

sh build.sh linux /data/server/confd
#执行以上构建脚本后,在docs目录下生成了安装所需的文件
#若build.sh增加了参数$2,则默认加载$2/data/config.toml作为confd运行所需的配置文件

cd docs
sh install.sh /data/server/confd
cd /data/server/confd 
#注意修改${path}/data/config.toml里的ConfDir和ConnectAddr,前缀为/data/server/confd

#然后使用confd、confd-cli即可

使用

.
├── confd
├── confd-cli
├── data
│   ├── config.toml
│   └── filestore.toml
├── meta
│   ├── example_1.toml
│   └── example_2.toml
└── templates
    └── example.tmpl

confd的使用:

  • 首先了解:
    • confd的配置可参看config.toml, config.toml里的配置均可通过运行时指定flag来覆盖默认配置。
    • confd.toml中指定的配置数据存储为“file”形式,即数据存储在同目录下filestore.toml文件中。
    • 根据需要编辑模板,参考example.tmpl,模板中使用的变量目前只支持k/v形式。
    • 根据需要编辑meta文件,参考example_1.toml,meta文件指定了生成最终配置文件时需要的模板文件、数据、最终文件地址等。
  • 命令
    • ./confd, 在各个meta文件指定的目的地址生成了需要的配置文件
    • ./confd --debug=false, 默认confd在后台运行,每10分钟重新生成一次全部的配置文件

confd-cli的使用:

  • confd-cli是操作confd的命令行程序

  • 目前支持的子命令

    ./confd-cli getall 获取当前所有配置需要的数据
    ./confd-cli get key1 获取key1现在的值
    ./confd-cli set key1 value1 设置key1值为value1
    ./confd-cli delete key1 删除key1

confd's People

Contributors

sumory avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.