GithubHelp home page GithubHelp logo

baidu / brcc Goto Github PK

View Code? Open in Web Editor NEW
386.0 24.0 90.0 15.69 MB

BRCC(better remote config center)是一个分布式配置中心,用于统一管理应用服务的配置信息,避免各类资源散落在各个项目中,简化资源配置的维护成本。作为一种轻量级的解决方案,部署简单,同时支持多环境、多版本、多角色的资源管理,可以在不改变应用源码的情况下无缝切换和实时生效配置信息。

Home Page: https://baidu.github.io/brcc/

License: Apache License 2.0

Java 98.99% HTML 0.06% Shell 0.09% Dockerfile 0.02% Go 0.84%
brcc java sdk-go sdk-java go

brcc's Introduction

house.baidu.com

brcc's People

Contributors

aroundpie avatar cocytus1223 avatar dislazy avatar fkzhao avatar ghzengqy568 avatar hubeicaolei avatar jhunters avatar sns1988 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

brcc's Issues

逐条配置bug

问题:逐条配置时,可以不断开启输入框,但是任意点一个保存,其他全部被清除
复现步骤:
1、打开配置 点击逐条配置
2、点击增加配置,多点几次,多输入一些数值
3、点击任意一个保存,其他条目全部被清空
建议的解决方案:

  • 当一条配置在编辑时,不允许点击增加配置

image

添加成员没有提示

工程添加成员的时候,如果一次性增加多个,没有提示用英文逗号还是封号,一旦写错,自己的产品线也看不到了,不太友好

服务端启动报ERR Client sent AUTH, but no password is set

org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis; nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to x.x.x.x:x
at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$ExceptionTranslatingConnectionProvider.translateException(LettuceConnectionFactory.java:1553) ~[spring-data-redis-2.4.1.jar:2.4.1]
....
Caused by: io.lettuce.core.RedisCommandExecutionException: ERR Client sent AUTH, but no password is set
at io.lettuce.core.internal.ExceptionFactory.createExecutionException(ExceptionFactory.java:137) ~[lettuce-core-6.0.1.RELEASE.jar:6.0.1.RELEASE]
at io.lettuce.core.internal.ExceptionFactory.createExecutionException(ExceptionFactory.java:110) ~[lettuce-core-6.0.1.RELEASE.jar:6.0.1.RELEASE]
at io.lettuce.core.protocol.AsyncCommand.completeResult(AsyncCommand.java:120) ~[lettuce-core-6.0.1.RELEASE.jar:6.0.1.RELEASE]

建议修改用户名功能

在【权限管理】下没有权限回收相关操作,还有就是用户名没有修改,比如第一次邮箱填错了,没有删除也没有修改

推送变更后的反馈希望细化

配置推送以后,操作日志里看到的反馈是『success』。希望再细化一下,显示推送了多少台实例,多少成功。这个环节还可以考虑增加推送结果失败的情况,比如配置项有格式错误,到了具体的实例端应用ConfigItemChangedCallable接口以后才能发现错误。如果能在配置中心有推送错误的提示,那就方便多了

希望增加配置项的备注

修改配置项的时候,希望能增加个配置项的备注。有时候配置多了,不记得配置项的含义或者配置项的格式

There is a vulnerability in spring-boot 1.5.12.RELEASE ,upgrade recommended

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<version>1.5.12.RELEASE</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
<version>1.5.12.RELEASE</version>
<optional>true</optional>
</dependency>

CVE-2020-5421

Recommended upgrade version:2.1.17.RELEASE

mybatis-spring-2.0.5 MapperScannerConfigurer 导致brcc多次加载

现象:
引入mybatis-spring-boot-starter 2.1.3 (对应mybatis-spring 2.0.5)后, 在多数据源情况下sdk多次加载brcc配置。
问题分析:
项目中多数据源情况下, 通过@MapperScan指定扫描不同的package和sqlSessionFactory, @MapperScan -> @import(MapperScannerRegistrar.class) -> MapperScannerConfigurer
MapperScannerConfigurer 实现了BeanDefinitionRegistryPostProcessor接口, 在配置processPropertyPlaceHolders为true的情况下会调用processPropertyPlaceHolders()方法
`
private void processPropertyPlaceHolders() {
// 获取到brcc的ConfigCenterPropertyPlaceholderConfigurer
Map<String, PropertyResourceConfigurer> prcs = applicationContext.getBeansOfType(PropertyResourceConfigurer.class,
false, false);

if (!prcs.isEmpty() && applicationContext instanceof ConfigurableApplicationContext) {
  BeanDefinition mapperScannerBean = ((ConfigurableApplicationContext) applicationContext).getBeanFactory()
      .getBeanDefinition(beanName);

  // PropertyResourceConfigurer does not expose any methods to explicitly perform
  // property placeholder substitution. Instead, create a BeanFactory that just
  // contains this mapper scanner and post process the factory.
  DefaultListableBeanFactory factory = new DefaultListableBeanFactory();
  factory.registerBeanDefinition(beanName, mapperScannerBean);

  for (PropertyResourceConfigurer prc : prcs.values()) {
    // 主动调用brcc替换mapperScannerBean中的属性
    prc.postProcessBeanFactory(factory);
  }

  PropertyValues values = mapperScannerBean.getPropertyValues();

  this.basePackage = updatePropertyValue("basePackage", values);
  this.sqlSessionFactoryBeanName = updatePropertyValue("sqlSessionFactoryBeanName", values);
  this.sqlSessionTemplateBeanName = updatePropertyValue("sqlSessionTemplateBeanName", values);
  this.lazyInitialization = updatePropertyValue("lazyInitialization", values);
}
this.basePackage = Optional.ofNullable(this.basePackage).map(getEnvironment()::resolvePlaceholders).orElse(null);
this.sqlSessionFactoryBeanName = Optional.ofNullable(this.sqlSessionFactoryBeanName)
    .map(getEnvironment()::resolvePlaceholders).orElse(null);
this.sqlSessionTemplateBeanName = Optional.ofNullable(this.sqlSessionTemplateBeanName)
    .map(getEnvironment()::resolvePlaceholders).orElse(null);
this.lazyInitialization = Optional.ofNullable(this.lazyInitialization).map(getEnvironment()::resolvePlaceholders)
    .orElse(null);

}

`
这样导致了brcc多次远程调用

解析不到配置${xxx}

debug看调用PropertiesLoaderSupport.mergeProperties方法返回空的,是调用loadProperties方法时拿不到brcc的配置数据
image

Go客户端的SDK地址

  • 支持Java、Go客户端以SDK方式接入
    看readme中描述支持Go客户端以sdk方式接入,能发一下go的sdk地址吗

修改license文件头

统一替换为

/*
 * Copyright (c) Baidu Inc. All rights reserved.
 * 
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You 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.
 */

提供一个发展思路(探讨)

项目本身模块化微服务,单个服务的配置如下图:
image
在有将现在有的服务迁移至Brcc统一配置中心的时候,会发现有问题:
原项目实际运行时,是需要指定activeprofile的,activeprofile实际的文件是 application.yaml和application-[profile].yaml的合并结果,配置荐较多的配置文件将配置项拆开往brcc上复写是一个比较痛苦的事情,那就带来了接下来的两个方向:
是否支持直接以配置文件的方式进行导入,brcc自动做前缀填充,能节省相当大的在线填写配置的时间
或者直接支持配置文件的变更Hook,直接以配置文件的形式来实现K-V的统一管理

支持按配置查询后批量修改

在使用过程中,常常有很多配置项是一样的,希望能够有对配置的key或者value进行批量查询后进行批量修改的功能

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.