QConf 简易部署和使用

Carey Tzou edited this page Aug 10, 2016 · 3 revisions

相关视频地址:QConf 简易使用视频

一、安装QConf 有如下两种方式可以安装QConf,可以根据自己的情况来决定:

1. 使用源码安装
    1)git clone https://github.com/Qihoo360/QConf.git
    2) cd QConf && mkdir build && cmake .
    3) make
    4) make install

2. 使用rpm包安装
    1) 根据不同的CentOS 系统下载不同的rpm包
        下载页面:https://github.com/Qihoo360/QConf/releases
        如果是CentOS 6.*,则下载:QConf-1.0.0-1.el6.x86_64.rpm
        如果是CentOS 5.*,则下载:QConf-1.0.0-1.el5.x86_64.rpm
    2) rpm -ivh QConf-1.0.0-1.el5.x86_64.rpm

二、使用QConf

1. 启动qconf-agent
    1) cd /usr/local/qconf
    2) cd bin && sh agent-cmd.sh start
    3) export PATH=$PATH:/usr/local/qconf/bin

2. 先部署zookeeper服务器
    1) wget http://mirror.bit.edu.cn/apache/zookeeper/zookeeper-3.3.6/zookeeper-3.3.6.tar.gz
    2) tar -zxv -f zookeeper-3.3.6.tar.gz
    3) cd zookeeper-3.3.6/conf && cp zoo_sample.cfg zoo.cfg
    4) cd ../bin && sh zkServer.sh start
    5) 创建配置节点(这个后续会提供页面来处理):
        sh zkCli.sh

        create /demo demo
        create /demo/confs confs
        create /demo/confs/conf1 111111111111111111111
        create /demo/confs/conf2 222222222222222222222
        create /demo/confs/conf3 333333333333333333333

3. 获取值
    1) 使用 shell 命令获取:
        qconf get_conf /demo/confs/conf1
        qconf get_batch_keys /demo/confs
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.