mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2026-01-03 20:35:29 +08:00
微服务重大升级说明(暂时只升级后台3.4.0)
-升级Spring Cloud Alibaba 2021.0.1.0,使用 spring.config.import 方式引入nacos配置 -拆分jeecg-boot-starter出来,使用独立项目维护
This commit is contained in:
@ -10,6 +10,6 @@ WORKDIR /jeecg-cloud-sentinel
|
||||
|
||||
EXPOSE 8848
|
||||
|
||||
ADD ./target/jeecg-cloud-sentinel-3.3.0.jar ./
|
||||
ADD ./target/jeecg-cloud-sentinel-3.4.0.jar ./
|
||||
|
||||
CMD sleep 5;java -Dfile.encoding=utf-8 -Djava.security.egd=file:/dev/./urandom -jar jeecg-cloud-sentinel-3.3.0.jar
|
||||
CMD sleep 5;java -Dfile.encoding=utf-8 -Djava.security.egd=file:/dev/./urandom -jar jeecg-cloud-sentinel-3.4.0.jar
|
||||
|
||||
@ -4,6 +4,6 @@
|
||||
|
||||
# 使用方法
|
||||
|
||||
- 1、第一次登录sentinel内容是空的,必须访问了微服务实例才有配置
|
||||
- 1、第一次登录sentinel内容是空的,必须访问了微服务实例的请求才会出现配置
|
||||
- 2、sentinel做了深度改造,支持持久化到nacos中
|
||||
- 3、目前只针对gateway做的控制,其他服务不需要
|
||||
|
||||
@ -5,31 +5,12 @@
|
||||
<parent>
|
||||
<artifactId>jeecg-cloud-module</artifactId>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<version>3.3.0</version>
|
||||
<version>3.4.0</version>
|
||||
</parent>
|
||||
<artifactId>jeecg-cloud-sentinel</artifactId>
|
||||
<name>jeecg-cloud-sentinel</name>
|
||||
<description>sentinel启动模块</description>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>aliyun</id>
|
||||
<name>aliyun Repository</name>
|
||||
<url>https://maven.aliyun.com/repository/public</url>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>jeecg</id>
|
||||
<name>jeecg Repository</name>
|
||||
<url>https://maven.jeecg.org/nexus/content/repositories/jeecg</url>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework.cloud</groupId>
|
||||
|
||||
@ -24,6 +24,7 @@ import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.*;
|
||||
import com.alibaba.csp.sentinel.dashboard.rule.nacos.entity.AuthorityRuleCorrectEntity;
|
||||
import com.alibaba.csp.sentinel.dashboard.rule.nacos.entity.ParamFlowRuleCorrectEntity;
|
||||
import com.alibaba.nacos.api.PropertyKeyConst;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@ -150,8 +151,12 @@ public class SentinelConfig {
|
||||
public ConfigService nacosConfigService() throws Exception {
|
||||
Properties properties=new Properties();
|
||||
properties.put(PropertyKeyConst.SERVER_ADDR,nacosConfigProperties.getServerAddr());
|
||||
properties.put(PropertyKeyConst.USERNAME,nacosConfigProperties.getUsername());
|
||||
properties.put(PropertyKeyConst.PASSWORD,nacosConfigProperties.getPassword());
|
||||
if(StringUtils.isNotBlank(nacosConfigProperties.getUsername())){
|
||||
properties.put(PropertyKeyConst.USERNAME,nacosConfigProperties.getUsername());
|
||||
}
|
||||
if(StringUtils.isNotBlank(nacosConfigProperties.getPassword())){
|
||||
properties.put(PropertyKeyConst.PASSWORD,nacosConfigProperties.getPassword());
|
||||
}
|
||||
return ConfigFactory.createConfigService(properties);
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,8 +32,6 @@ logging:
|
||||
nacos:
|
||||
server:
|
||||
ip: @config.server-addr@
|
||||
password: @config.password@
|
||||
username: @config.username@
|
||||
sentinel:
|
||||
dashboard:
|
||||
version: 1.8.2
|
||||
Reference in New Issue
Block a user