Code Monkey home page Code Monkey logo

cloud-config's Introduction

cloud-config

cloud-config is a multi-tenant-aware configuaration center based on Zookeeper and tightly integrated with Spring framework which is inspired by Centralized Application Configuration with Spring and Apache ZooKeeper.

How to Start

  1. Run following scripts to build entire project after sync the latest code

    cd cloud-config-ui && npm install && cd .. && mvn clean install
  2. Install & Start Zookeeper server

  3. Start cloud-config-server application

    java -Dnamespace={namespace} -Dconfig.center.url={zk.url} -jar cloud-config-server/target/cloud-config-server-1.0.0-SNAPSHOT.jar  
  4. Go to http://localhost:8001/ in browser

How to Use

  1. import cloud-config-client as your project maven dependency, e.g.

    <dependency>
        <groupId>org.squirrelframework</groupId>
        <artifactId>cloud-config-client</artifactId>
        <version>1.0.0-SNAPSHOT</version>
    </dependency>
  2. simple usage configuration, e.g.

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:cc="http://www.squirrelframework.org/schema/config"
        xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.squirrelframework.org/schema/config
        http://www.squirrelframework.org/schema/config/cloud-config.xsd">
    	<!-- config zookeeper client -->
    	<cc:zk-client connection-string="127.0.0.1:2181" credential-string="user:passwd"/>
    	<!-- config as property place holder -->
    	<cc:zk-property-placeholder path="/mail, /query" location="classpath:query-server.properties"/>
    	<!-- config as jdbc dataSource -->
    	<cc:zk-jdbc-datasource id="dataSource" path="/database/mydb" resource-type="C3P0"/>
    </beans>

Docker Support

  1. Build cloud config docker container

    cd ${cloud-config-prj-folder}
    docker build -t hekailiang/cloud-config .   
  2. Run docker container for cloud config

    docker run -d -p 8001:8001 --name cc -e ZK_URL={zkserver} hekailiang/cloud-config
  3. For MacOS users, use following command to simplify docker machine access

    echo $(docker-machine ip default) dockerhost | sudo tee -a /etc/hosts
  4. Go to http://dockerhost:8001 in browser

Dock Compose Support

cd ${cloud-config-prj-folder}
docker-compose up

Features

  1. System properties config and lookup
  2. Single or Multi-tenant-aware DataSource config and lookup
  3. Custom resource object config and lookup

Rencent Goal

  1. Integrate with Docker to provide live demo
  2. Enhance UI and documentation

cloud-config's People

Contributors

hekailiang avatar mokk43 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.