QConf

QConf 是一个分布式配置管理工具。「Qihoo Distributed Configuration Management System」

Github星跟蹤圖

QConf

Build Status

We have build another interesting proect pika. Pika is a nosql compatible with redis protocol with huge storage space. You can have a try.

Introduction 中文

QConf is a Distributed 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.

Features

  • Changes to any configuration will be synchronised to all client machines in real-time.
  • High query efficiency.
  • Convenient deployment and simple interface.
  • High robustness and fault-tolerance.
  • support c/c++, shell, php, python, lua, java, go, node and etc.

Install

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

Usage

  • 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
  • zkdash - An excellent dashboard for QConf or ZooKeeper provided by IReader Team

Performance

  1. statergy
  • running times : ten million times altogether
  • data size : the size of value of each key is 1k
  • test method : multi-processes are running at the same time, and get the elapsed time that ten million times are running
  • machine : Intel(R) Xeon(R) CPU E5-2630 0 @ 2.30GHz, 24 cores; 64G memory
  • language : c++
  1. result
  • enter image description here
  1. conclusion:
  • the lantency is 16μs
  • during multi-process, the QPS can reach one million

Example

  • shell
    qconf get_conf /demo/node1   # get the value of '/demo/node1'
  • c/c++
	  // 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);
      
      // Destroy qconf env
      qconf_destroy();

Document

Contact

主要指標

概覽
名稱與所有者Qihoo360/QConf
主編程語言C++
編程語言CMake (語言數: 18)
平台
許可證Other
所有者活动
創建於2015-03-20 11:35:35
推送於2024-02-02 08:35:23
最后一次提交2024-02-02 16:35:23
發布數8
最新版本名稱v1.2.3 (發布於 2018-05-24 14:49:21)
第一版名稱1.0.0 (發布於 )
用户参与
星數1.9k
關注者數208
派生數536
提交數165
已啟用問題?
問題數112
打開的問題數27
拉請求數17
打開的拉請求數1
關閉的拉請求數4
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?