Java Web学习总结(23)——Distributed Configuration Management Platform(分布式配置管理平台)...

专注于各种 分布式系统配置管理 的通用组件/通用平台, 提供统一的配置管理服务

主要目标:

  • 部署极其简单:同一个上线包,无须改动配置,即可在 多个环境中(RD/QA/PRODUCTION) 上线
  • 部署动态化:更改配置,无需重新打包或重启,即可 实时生效
  • 统一管理:提供web平台,统一管理 多个环境(RD/QA/PRODUCTION)、多个产品 的所有配置

项目信息

  • CLIENT 端:
    • Java: 目前唯一支持语言
    • python:打算支持
    • PHP:暂未支持
  • WEB 管理端:
    • Java SpringMvc 实现,前后端分离 实现方式(基于Spring 4.1.7.RELEASE)

java client

disconf.git branches and Maven version:

Java Client Elegant Usage Preview

当前版本功能特点

  • 支持配置(配置项+配置文件)的分布式化管理
  • 配置发布统一化
  • 极简的使用方式(注解式编程 或 XML无代码侵入模式)
  • 低侵入性或无侵入性、强兼容性

未来版本(完全版)功能特点

Disconf的功能特点描述图:

查看大图

重要功能特点

  • 支持配置(配置项+配置文件)的分布式化管理
  • 配置发布统一化
    • 配置发布、更新统一化:
      • 同一个上线包 无须改动配置 即可在 多个环境中(RD/QA/PRODUCTION) 上线
      • 配置存储在云端系统,用户统一管理 多个环境(RD/QA/PRODUCTION)、多个平台 的所有配置
    • 配置更新自动化:用户在平台更新配置,使用该配置的系统会自动发现该情况,并应用新配置。特殊地,如果用户为此配置定义了回调函数类,则此函数类会被自动调用。
  • 配置异构系统管理
    • 异构包部署统一化:这里的异构系统是指一个系统部署多个实例时,由于配置不同,从而需要多个部署包(jar或war)的情况(下同)。使用Disconf后,异构系统的部署只需要一个部署包,不同实例的配置会自动分配。特别地,在业界大量使用部署虚拟化(如JPAAS系统,SAE,BAE)的情况下,同一个系统使用同一个部署包的情景会越来越多,Disconf可以很自然地与他天然契合。
    • 异构主备自动切换:如果一个异构系统存在主备机,主机发生挂机时,备机可以自动获取主机配置从而变成主机。
    • 异构主备机Context共享工具:异构系统下,主备机切换时可能需要共享Context。可以使用Context共享工具来共享主备的Context。
  • 极简的使用方式(注解式编程 或 XML无代码侵入模式):我们追求的是极简的、用户编程体验良好的编程方式。目前支持两种开发模式:基于XML配置或者基于注解,即可完成复杂的配置分布式化。

注:配置项是指某个类里的某个Field字段。

其它功能特点

  • 低侵入性或无侵入性、强兼容性:
    • 低侵入性:通过极少的注解式代码撰写,即可实现分布式配置。
    • 无侵入性:通过XML简单配置,即可实现分布式配置。
    • 强兼容性:为程序添加了分布式配置注解后,开启Disconf则使用分布式配置;若关闭Disconf则使用本地配置;若开启Disconf后disconf-web不能正常Work,则Disconf使用本地配置。
  • 支持配置项多个项目共享,支持批量处理项目配置。
  • 配置监控:平台提供自校验功能(进一步提高稳定性),可以定时校验应用系统的配置是否正确。

模块架构图

查看大图

模块信息

  • disconf
    • CLIENT: client目标是支持多语言。目前只提供了java语言客户端。
      • JAVA
        • disconf-core: 分布式配置基础包模块
        • disconf-client: 分布式配置客户端模块, 依赖disconf-core包。 用户程序使用它作为Jar包进行分布式配置编程。
        • disconf-tool: 分布式配置工具包,依赖disconf-core包。 Disconf-tool是disconf的辅助工具类, 目前使用不多,建议不使用。
    • 管理端:disconf-web是统一的分布式配置管理平台。disconf-web: 分布式配置平台服务模块, 依赖disconf-core包。采用SpringMvc+纯HTML方式(前后端分离架构)实现。用户使用它来进行日常的分布式配置管理。
  • demo

用户指南

clint

java client: disconf-client 使用

在您的 Maven POM 文件里加入:

<dependency>
    <groupId>com.baidu.disconf</groupId>
    <artifactId>disconf-client</artifactId>
    <version>2.6.27</version>
</dependency>

server: disconf-web 使用

部署方法请参见:https://github.com/knightliao/disconf/tree/master/disconf-web

全新主页,高清大图:

APP+环境+版本+ZK查询:

http://ww1.sinaimg.cn/mw1024/60c9620fgw1emyww39wjmj20qw0keq6m.jpg

java client Tutorials

总体概述
基于注解式的分布式配置(支持配置文件和配置项)

推荐新建的项目使用disconf时使用

注:将配置文件移至一个专有类里,而不是分散在项目的各个地方,整个代码架构清晰易懂、易管理。 即便如果哪天不使用disconf,也只需要将注解去掉即可。

基于XML的分布式配置(无代码侵入)(仅支持配置文件)

推荐旧项目使用disconf时使用

其它

详细设计和讨论

大家都在使用disconf

转载于:https://www.cnblogs.com/zhanghaiyang/p/7213589.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Computers and computer networks are one of the most incredible inventions of the 20th century, having an ever-expanding role in our daily lives by enabling complex human activities in areas such as entertainment, education, and commerce. One of the most challenging problems in computer science for the 21st century is to improve the design of distributed systems where computing devices have to work together as a team to achieve common goals. In this book, I have tried to gently introduce the general reader to some of the most fundamental issues and classical results of computer science underlying the design of algorithms for distributed systems, so that the reader can get a feel of the nature of this exciting and fascinating field called distributed computing. The book will appeal to the educated layperson and requires no computer-related background. I strongly suspect that also most computer-knowledgeable readers will be able to learn something new. Gadi Taubenfeld is a professor and past dean of the School of Computer Science at the Interdisciplinary Center in Herzliya, Israel. He is an established authority in the area of concurrent and distributed computing and has published widely in leading journals and conferences. He authored the book Synchronization Algorithms and Concurrent Programming, published by Pearson Education. His primary research interests are in concurrent and distributed computing. Gadi was the head of the computer science division at Israel's Open University; member of technical staff at AT&T Bell Laboratories; consultant to AT&T Labs–Research; and a research scientist and lecturer at Yale University. Gadi served as the program committee chair of PODC 2013 and DISC 2008 and holds a Ph.D. in Computer Science from the Technion–Israel Institute of Technology.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值