zoukankan      html  css  js  c++  java
  • QConf简要搭建过程

    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.

    1、准备环境

    #yum install -y cmake
    #yum install -y gdbm gdbm-devel
    #yum install -y automake-devel autoconf m4 perl perl-devel gcc-c++
    

    2、拉取代码,编译安装

    # git clone https://github.com/Qihoo360/QConf.git
    # cd QConf 
    # mkdir build && cd build
    # cmake .. -DCMAKE_INSTALL_PREFIX=/opt/qconf
    # make
    # make install 
    

    3、在QConf 配置文件中配置Zookeeper集群地址

    #vim /opt/qconf/conf/idc.conf
    # all the zookeeper host configuration.
    #[zookeeper]
    zookeeper.stg=172.40.0.215:2181,172.40.0.216:2181,172.40.0.217:2181
    

    4、在QConf配置文件中指定本地机房

    #vim /opt/qconf/conf/localidc.conf
    stg
    

    5、启动QConf

    # cd /opt/qconf/bin && bash agent-cmd.sh start
    # ps -ef | grep qconf
    	root     17703     1  0 13:30 ?        00:00:00 /opt/qconf/bin/qconf_agent
    	root     17704 17703  0 13:30 ?        00:00:08 /opt/qconf/bin/qconf_agent
    

    6、尝试用shell取值

    qconf 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
     
    # ln -sv /opt/qconf/bin/qconf /usr/bin/
    # qconf get_batch_keys configs
    	activity-backend
    	activity-front
    	backend-3.0
    	backend-card
    	backend-core
    	backend-credit
    	backend-franchisee
    	backend-member
    	backend-mobile
    	dfb-front
    	foo
    	front-agent
    	front-franchisee
    	msgcenter-backend
    	msgcenter-front
    # qconf get_conf /configs/backend-3.0/dfb3Service
    
  • 相关阅读:
    Web服务器的有关概念
    备份微信中大量的公众号,备份其二维码图片
    (转载)使用SecureCRT连接Linux时,alt + .等功能键不能使用的解决办法
    Q查询
    ManyToMany参数(through,db_constraint)
    formset批量处理form表单数据
    modelform动态显示select标签的对象范围
    request对象的常用属性和方法
    Django查询orm的前一天,前一周,一个月的数据
    render的几个应用
  • 原文地址:https://www.cnblogs.com/keithtt/p/6527957.html
Copyright © 2011-2022 走看看