-
Notifications
You must be signed in to change notification settings - Fork 534
Home
sn00py edited this page Dec 10, 2018
·
6 revisions
QConf is a Distrubuted Configuration Management System! A better replacement of the traditional configuration file. As designed, configuration items which is constantly accessed and modified should be completely separated with application code, and QConf is where it should be.
- Changes to any configuration will be synchronised across all client machines, in seconds.
- High query efficiency.
- Convenient deployment and simple interface.
- High robustness and fault-tolerance.
The QConf is built using CMake (version 2.6 or newer).
On most systems you can build the library using the following commands:
mkdir build && cd build
cmake ..
make
make install
Alternatively you can also point the CMake GUI tool to the CMakeLists.txt file.
To install the QConf you can specify the install prefix by setting:
cmake .. -DCMAKE_INSTALL_PREFIX=/install/prefix
-
Set up Zookeeper servers, create or modify znode with Zookeeper Client
More information about Zookeper: ZooKeeper Getting Started Guide
-
Register the Zookeeper server address with QConf
vi QCONF_INSTALL_PREFIX/conf/idc.conf
# all the zookeeper host configuration.
#[zookeeper]
zookeeper.test=127.0.0.1:2181,127.0.0.1:2182,127.0.0.1:2183 #zookeeper of idc 'test'
- Assign local idc
echo test > QCONF_INSTALL_PREFIX/conf/localidc #assign local idc to test
- Run QConf
cd QCONF_INSTALL_PREFIX/bin && sh agent-cmd.sh start
- Code to access QConf
- ZooKeeper as the server, restore all configurations, so the limit data size of single configuration item is 1MB, since the size limit of Znode.
- qconf_agent is a daemon run on client machine, maintain data in share memory.
- share memory, QConf use share memory as the local cache of all configuration items needed by current client.
- interface in different programming languages, chose your language for accessing of QConf.
- C Doc - the C reference to QConf APIs
- Python Doc - the Python reference to QConf APIs,Python 2.4, 2.5, 2.6 or 2.7 is required. Python 3.x is not yet supported.
- PHP Doc - the PHP reference to QConf APIs
- Shell Command - the command qconf can be use in command line
- LuaJit Doc - the LuaJit reference to QConf APIs
- zkdash - An excellent dashboard for QConf or ZooKeeper provided by IReader Team
- C Exmaple
// Init the qconf env
ret = qconf_init();
assert(QCONF_OK == ret);
// Get Conf value
char value[QCONF_CONF_BUF_MAX_LEN];
ret = qconf_get_conf("/demo/node1", value, sizeof(value), NULL);
assert(QCONF_OK == ret);
// Get Batch keys
string_vector_t bnodes_key;
init_string_vector(&bnodes_key);
ret = qconf_get_batch_keys("/demo/node2", &bnodes_key, NULL);
assert(QCONF_OK == ret);
int i = 0;
for (i = 0; i < bnodes_key.count; i++)
{
// get keys from bnodes_key.data[i]
}
destroy_string_vector(&bnodes_key);
// Destroy qconf env
qconf_destroy();
- Shell Exmaple
usage: qconf command key [idc]
command: can be one of below commands:
get_conf : get configure value
get_host : get one service
get_allhost : get all services available
get_batch_keys : get all children keys
key : the path of your configure items
idc : query from current idc if be omitted
example:
qconf get_conf "demo/conf"
qconf get_conf "demo/conf" "test"
- QConf Wiki
- FAQ
- Nginx 配置文件 脚本更新说明
- QConf 保证数据的正确性方法
- QConf 使用场景
- QConf 反馈服务器简单示例
- QConf 架构
- QConf 灰度发布功能说明
- QConf 简易部署和使用
- QConf monitor简易部署使用
- QConf Document
- QConf C\C++ Doc
- QConf Go Doc
- QConf Java Doc
- QConf LuaJit Doc
- QConf Node Doc
- QConf Perl Doc
- QConf PHP Doc
- QConf Python Doc
- QConf 管理端
- QConf 管理界面使用
- QConf 管理端接口(C )
- QConf 管理端接口(PHP)