1 Star 0 Fork 601

有色白水 / apollo

forked from apolloconfig / apollo 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

基础核心功能

配置类型

  • properties
  • file(xml,json, yml, yaml)

properties

  • portal
  • 支持单条配置项编辑
  • 支持以file级别编辑(迁移老项目properties,直接copy)
  • 可以查看每一个配置项的更改历史(追责,查问题等)
  • 配置需要发布才能生效(类似于code发布),发布时可以查看所有的配置修改
  • 记录发布历史
  • 配置发布后,所有的的client在1ms内,更新配置并回调监听事件
  • client
    • 通过 apollo-client API获取配置项
    • client api强制用户传入default值,作为最后一层保险(config cache layer)
      1. client memory cache
      2. client file cache
      3. config server file cache
      4. db
    • 通过http restful api获取properties文件
    • client可以监听每一个key的change事件

file

  • protal
    • 文本直接编辑
    • 发布时,显示 diff
    • 记录修改、发布历史
  • client
    • 以String返回file
    • 可以监听change事件

高级进阶功能

以上功能是配置中心的核心功能,后台修改配置及时通知到客户端,以及客户端可以监听change事件。如果只支持这些,那么就没必要拿出来卖了~

###高级功能1 --- 配置回滚 配置只有发布后才会生效,有发布当然有回滚啦,虽然功能不大,但是实用价值明显。在发布历史页面可以明确看到那一份是最新配置,哪些是回滚作废了配置。

高级功能2 --- 配置分集群

同一份代码,同一个包在多个DC,或者在不同的cluster配置可能不一致。比如主DC的机器性能更好,可以提供更强大的服务,所以设置的路由优先级高。

高级功能3 --- 配置有继承关系

场景:业务依赖某公共组件,公共组件配置默认值,业务方可以自定义配置且覆盖公共配置。但是不支持多层继承,最多两层。因为考虑多层继承会导致模型复杂度大大提升,犯错的几率也相应的提高。 配置有继承关系,虽然简单,但可以有无限的想象空间,应用空间。

高级功能4 --- 配置可以分组

一个app下面可以有多种类型的配置,配置分组便于管理和维护。一个组是一个namespace

高级功能5 --- 配置支持file

是不是很多老项目的配置是xml?完美支持~

高级功能6 --- 权限控制

所有的项目都有权限,现有的权限包括,namespace级别的编辑,发布权。项目级别的管理权限,包括创建cluster,创建namespace,分配namespace权限等。以及:namespace一次发布过程中编辑和发布不能为同一个人,强制增加review过程。我们的权限有何特殊之处呢?权限模型非常易于扩展~

高级功能7 --- http restful api

我们内部client端已支持java和.net版本,但是还有很多其他语言未支持。同时,在推广过程中发现很多团队自己搞过简易版的“配置中心”,不想接入client,而是为其提供restful,便于迁移。

###高级功能8 --- open api 传统的配置中心,client端只有查询配置的功能。携程内部推广的过程中用户有以下两点需求:

  1. 用户的用户是运营同学,不应该让他们直接使用配置中心的后台,而是用户自己封装业务场景,然后调用我们的存储配置api
  2. 我们的portal支持绝大部分使用场景,但是有些部门的配置需要做比如校验、预处理等操作

针对第二种场景,如果我们为其开发校验、预处理功能,那么我们的portal将会被污染且不可控。这部分功能应由用户自己去开发,然后调用我们的open api。 开放那些接口以及做到那种程度的auth,我们都经过深入的考虑。

###高级功能9 --- 可以查看配置实例信息 portal能看到配置信息,但是对于client 实例一无所知?那些应用,哪些机器用了我的配置?每台机器都用了哪份配置?某台机器是不是用了最新的配置?所有信息一览无余~

###高级功能10 --- 配置灰度发布 | ABTest 场景:调整某个配置参数,先看一下某台机器的效果,而不是全部的机器。跟应用的灰度发布场景一致

附:portal项目主页(更多设计以及portal交互请查看附件)

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright {yyyy} {name of copyright owner} Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

携程框架研发团队强力打造的配置中心,微服务轻量级。spring-boot(spring-mvc spring-security spring-data-jpa spring-boot-test) + eureka + mockito + AngularJS. spring最新技术体系完美诠释 展开 收起
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/iuyes/apollo.git
git@gitee.com:iuyes/apollo.git
iuyes
apollo
apollo
master

搜索帮助