Code Monkey home page Code Monkey logo

qconf's Introduction

QConf

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

Related

  • 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

qconf's People

Contributors

bale-john avatar catkang avatar cdoco avatar chancey avatar havetrytwo avatar monque avatar paderma avatar truexf avatar

Watchers

 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.