iis服务器助手广告广告
返回顶部
首页 > 资讯 > 后端开发 > Python >SpringCloud高可用配置中心Config详解
  • 210
分享到

SpringCloud高可用配置中心Config详解

2024-04-02 19:04:59 210人浏览 泡泡鱼

Python 官方文档:入门教程 => 点击学习

摘要

目录前言源码环境开发工具正文commons 工程commons 工程 - POM 文件commons 工程 - 项目结构配置文件service 工程reGIStry-service(

前言

SpringCloud微服务中的翘楚,最佳的落地方案。

spring cloud Config 是一个解决分布式系统的配置管理方案,它包含了 server 和 client 两个部分。

server 用来获取远程的配置信息(默认为 git 仓库),并且以接口的形式提供出去;

client 根据 server 提供的接口读取配置文件,以便于初始化自己的应用。

如果配置中心出现了问题,将导致灾难性的后果,因此在生产环境下配置中心都会做集群,来保证高可用

此处配置高可用实际就是把多个配置中心(指定同一个 Git 远程仓库)注册到注册中心。

源码

GitHub地址:https://github.com/intomylife/springCloud

环境

开发工具

IntelliJ IDEA

正文

commons 工程

commons 工程 - POM 文件

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="Http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <!-- 三坐标 -->
    <groupId>com.zwc</groupId>
    <artifactId>springcloud-config-eureka-commons</artifactId>
    <version>1.0</version>
    <!-- 工程名称和描述 -->
    <name>springcloud-config-eureka-commons</name>
    <description>公用工程</description>
    <!-- 打包方式 -->
    <packaging>jar</packaging>
    <!-- 在 properties下声明相应的版本信息,然后在dependency下引用的时候用 ${} 就可以引入该版本jar包了 -->
    <properties>
        <!-- 编码 -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <!-- jdk -->
        <java.version>1.8</java.version>
        <!-- SpringBoot -->
        <platfORM-bom.version>Cairo-SR3</platform-bom.version>
        <!-- SpringCloud -->
        <spring-cloud-dependencies.version>Finchley.RELEASE</spring-cloud-dependencies.version>
    </properties>
    <!-- 加入依赖 -->
    <dependencies>
    </dependencies>
    <!-- 依赖 jar 包版本管理的管理器 -->
    <!-- 如果 dependencies 里的 dependency 自己没有声明 version 元素,那么 maven 就此处来找版本声明。 -->
    <!-- 如果有,就会继承它;如果没有就会报错,告诉你没有版本信息 -->
    <!-- 优先级:如果 dependencies 里的 dependency 已经声明了版本信息,就不会生效此处的版本信息了 -->
    <dependencyManagement>
        <dependencies>
            <!-- SpringBoot -->
            <dependency>
                <groupId>io.spring.platform</groupId>
                <artifactId>platform-bom</artifactId>
                <version>${platform-bom.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- SpringCloud -->
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud-dependencies.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <!-- 插件依赖 -->
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>

配置一些共用依赖

commons 工程 - 项目结构

配置文件

创建一个 Git 库,里面存放配置文件,文件夹名称为:config-repo;这里模拟不同的环境,所以分别构建了

dev(开发)、uat(测试)以及online(线上)三种不同的配置文件;此文件夹存在此项目的根目录中

- springcloud-config-eureka
? - config-repo
? ? -?system-dev.properties
? ? -?system-online.properties
? ? -?system-uat.properties
  + springcloud-config-eureka-commons
  + springcloud-config-eureka-service

service 工程

① 此工程下有四个模块:一个注册中心,二个 server 以及一个 client

② 二个 server 除端口不一致以外,其他代码基本一致

registry-service(注册中心)

registry-service - POM 文件

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <!-- 继承父 -->
    <parent>
        <groupId>com.zwc</groupId>
        <artifactId>springcloud-config-eureka-service</artifactId>
        <version>1.0</version>
    </parent>
    <!-- 三坐标 -->
    <groupId>com.zwc</groupId>
    <artifactId>springcloud-config-eureka-registry-service</artifactId>
    <version>1.0</version>
    <!-- 工程名称描述 -->
    <name>springcloud-config-eureka-registry-service</name>
    <description>注册中心</description>
    <!-- 打包方式 -->
    <packaging>jar</packaging>
    <!-- 在 properties下声明相应的版本信息,然后在dependency下引用的时候用 ${} 就可以引入该版本jar包了 -->
    <properties>
    </properties>
    <!-- 加入依赖 -->
    <dependencies>
        <!-- commons工程 依赖 -->
        <dependency>
            <groupId>com.zwc</groupId>
            <artifactId>springcloud-config-eureka-commons</artifactId>
            <version>1.0</version>
        </dependency>
        <!-- 服务注册中心 -->
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
    </dependencies>
    <!-- 插件依赖 -->
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>

主要加入spring-cloud-starter-netflix-eureka-server依赖

registry-service - application.yml配置文件

# 端口
server:
  port: 8761
# 应用名称
spring:
  application:
    name: eureka-server
eureka:
  instance:
    # 使用 ip 代替实例名
    prefer-ip-address: true
    # 实例的主机名
    hostname: ${spring.cloud.client.ip-address}
    # 实例的 ID 规则
    instance-id: ${spring.cloud.client.ip-address}:${spring.application.name}:${server.port}
  client:
    # 是否向注册中心注册自己
    registerWithEureka: false
    # 是否向注册中心获取注册信息
    fetchRegistry: false
    serviceUrl:
      # 注册中心地址
      defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/

这里使用了默认的 8761 端口,当然也可以更改,不过在发现调用服务端的注册中心地址端口要与它一致

registry-service - 启动类

package com.zwc;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
@SpringBootApplication
@EnableEurekaServer
public class SpringcloudConfigEurekaRegistryServiceApplication {
    public static void main(String[] args) {
        SpringApplication.run(SpringcloudConfigEurekaRegistryServiceApplication.class, args);
    }
}

在启动类中添加 @EnableEurekaServer 注解表示此工程是注册中心

registry-server - 启动项目

1. 项目启动成功后访问http://localhost:8761/即可看到eureka-server 主页面

server(获取远程的配置信息)

server- POM 文件

注:一共有两个 server,但是除端口以外的代码基本上一致,所有这里就列举其中一个

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <!-- 继承父 -->
    <parent>
        <groupId>com.zwc</groupId>
        <artifactId>springcloud-config-eureka-service</artifactId>
        <version>1.0</version>
    </parent>
    <!-- 三坐标 -->
    <groupId>com.zwc</groupId>
    <artifactId>springcloud-config-eureka-serverfirst-service</artifactId>
    <version>1.0</version>
    <!-- 工程名称描述 -->
    <name>springcloud-config-eureka-serverfirst-service</name>
    <description>config server</description>
    <!-- 打包方式 -->
    <packaging>jar</packaging>
    <!-- 在 properties下声明相应的版本信息,然后在dependency下引用的时候用 ${} 就可以引入该版本jar包了 -->
    <properties>
    </properties>
    <!-- 加入依赖 -->
    <dependencies>
        <!-- commons工程 依赖 -->
        <dependency>
            <groupId>com.zwc</groupId>
            <artifactId>springcloud-config-eureka-commons</artifactId>
            <version>1.0</version>
        </dependency>
        <!-- config server 依赖 -->
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-config-server</artifactId>
        <!-- 提供者消费者 -->
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
    </dependencies>
    <!-- 插件依赖 -->
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>
  • 加入spring-cloud-config-server依赖:config server
  • 加入spring-cloud-starter-netflix-eureka-client依赖:提供和注册服务

server- application.yml配置文件

# 端口
server:
  port: 8000

spring:
  application:
    # 应用名称
    name: config-eureka-server
  cloud:
    config:
      server:
        git:
          # 仓库地址
          uri: https://github.com/intomylife/SpringCloud
          # 对应 {label} 部分,即 Git 的分支
          label: master
          # 仓库文件夹名称,多个以逗号分隔
          search-paths: springcloud-config-eureka/config-repo
          # git 仓库用户名(公开库可以不用填写)
          username:
          # git 仓库密码(公开库可以不用填写)
          passWord:
eureka:
  instance:
    # 使用 ip 代替实例名
    prefer-ip-address: true
    # 实例的主机名
    hostname: ${spring.cloud.client.ip-address}
    # 实例的 ID 规则
    instance-id: ${spring.cloud.client.ip-address}:${spring.application.name}:${server.port}
  client:
    serviceUrl:
      # 注册中心地址
      defaultZone: http://${eureka.instance.hostname}:8761/eureka/
  • 注意这里 uri 只能写到仓库名
  • 如果配置文件在仓库中多层目录下,那么search-paths 就从根目录开始写起
  • 注意此处配置注册中心地址的端口为 8761 也就是上面注册中心工程配置的端口
package com.zwc;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.config.server.EnableConfigServer;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
@SpringBootApplication
@EnableConfigServer
@EnableEurekaClient
public class SpringcloudConfigEurekaServerfirstServiceApplication {
    public static void main(String[] args) {
        SpringApplication.run(SpringcloudConfigEurekaServerfirstServiceApplication.class, args);
    }
}
  • 添加@EnableConfigServer 注解表示开启配置中心
  • 添加 @EnableEurekaClient 注解表示此工程可以向注册中心提供服务

server- 启动项目

1.项目启动成功后访问:http://localhost:8761/(注册中心)可以看到服务已经被注册进来了

2. 访问地址:http://localhost:8000/config-repo/dev(获取完整配置信息)

3.输出内容:

{
    "name":"config-repo",
    "profiles":[
        "dev"
    ],
    "label":null,
    "version":"0d6480b5ba6f7f2be87b3130de8163Dcb0af9f5f",
    "state":null,
    "propertySources":[

    ]
}

4. 访问地址:http://localhost:8000/system/dev(获取完整配置信息)

5. 输出内容:

{
    "name":"system",
    "profiles":[
        "dev"
    ],
    "label":null,
    "version":"0d6480b5ba6f7f2be87b3130de8163dcb0af9f5f",
    "state":null,
    "propertySources":[
        {
            "name":"https://github.com/intomylife/SpringCloud/springcloud-config-eureka/config-repo/system-dev.properties",
            "source":{
                "hello":"I'm dev."
            }
        }
    ]
}

6. 访问地址:http://localhost:8000/system-dev.properties(获取指定配置文件内容)

7. 输出内容:‘hello: I’m dev.’

8. 启动另一个 server(springcloud-config-eureka-serversecond-service)

9.项目启动成功后访问:http://localhost:8761/(注册中心)可以看到服务已经被注册进来了

10.访问地址:http://localhost:8001/config-repo/uat(获取完整配置信息)

11. 输出内容:

{
    "name":"config-repo",
    "profiles":[
        "uat"
    ],
    "label":null,
    "version":"0d6480b5ba6f7f2be87b3130de8163dcb0af9f5f",
    "state":null,
    "propertySources":[

    ]
}

12.访问地址:http://localhost:8001/system/uat(获取完整配置信息)

13.输出内容:

{
    "name":"system",
    "profiles":[
        "uat"
    ],
    "label":null,
    "version":"0d6480b5ba6f7f2be87b3130de8163dcb0af9f5f",
    "state":null,
    "propertySources":[
        {
            "name":"https://github.com/intomylife/SpringCloud/springcloud-config-eureka/config-repo/system-uat.properties",
            "source":{
                "hello":"I'm uat."
            }
        }
    ]
}

14.访问地址:http://localhost:8001/system-uat.properties(获取指定配置文件内容)

15. 输出内容:‘hello: I’m uat.’

16. 证明两个 server 都已经成功从远程仓库中获取到了配置信息

注:接口访问有如下规则:

/{application}/{profile}[/{label}]
/{application}-{profile}.yml
/{label}/{application}-{profile}.yml
/{application}-{profile}.properties
/{label}/{application}-{profile}.properties

client(读取注册中心的server 中的配置信息)

client- POM 文件

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <!-- 继承父 -->
    <parent>
        <groupId>com.zwc</groupId>
        <artifactId>springcloud-config-eureka-service</artifactId>
        <version>1.0</version>
    </parent>
    <!-- 三坐标 -->
    <groupId>com.zwc</groupId>
    <artifactId>springcloud-config-eureka-client-service</artifactId>
    <version>1.0</version>
    <!-- 工程名称描述 -->
    <name>springcloud-config-eureka-client-service</name>
    <description>config client</description>
    <!-- 打包方式 -->
    <packaging>jar</packaging>
    <!-- 在 properties下声明相应的版本信息,然后在dependency下引用的时候用 ${} 就可以引入该版本jar包了 -->
    <properties>
    </properties>
    <!-- 加入依赖 -->
    <dependencies>
        <!-- commons工程 依赖 -->
        <dependency>
            <groupId>com.zwc</groupId>
            <artifactId>springcloud-config-eureka-commons</artifactId>
            <version>1.0</version>
        </dependency>
        <!-- config 依赖 -->
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-config</artifactId>
        <!-- 提供者消费者 -->
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
    </dependencies>
    <!-- 插件依赖 -->
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>
  • 加入spring-cloud-starter-config依赖:config client
  • 加入spring-cloud-starter-netflix-eureka-client依赖:提供和注册服务

client- application.yml配置文件

# 端口
server:
  port: 8002

spring:
  application:
    # 应用名称
    name: config-eureka-client

client- bootstrap.yml 配置文件(注意)

spring:
  cloud:
    config:
      # 对应 {label} 部分,即 Git 的分支
      label: master
      # 对应 {application} 部分
      name: system
      # 对应 {profile} 部分
      profile: dev
      discovery:
        # 开启 Config 服务发现与注册
        enabled: true
        # 指定 server
        service-id: config-eureka-server
eureka:
  instance:
    # 使用 ip 代替实例名
    prefer-ip-address: true
    # 实例的主机名
    hostname: ${spring.cloud.client.ip-address}
    # 实例的 ID 规则
    instance-id: ${spring.cloud.client.ip-address}:${spring.application.name}:${server.port}
  client:
    serviceUrl:
      # 注册中心地址
      defaultZone: http://${eureka.instance.hostname}:8761/eureka/
  • bootstrap.yml 配置文件加载先于application.yml 配置文件
  • 与 Spring Cloud Config 相关的属性必须配置在bootstrap.yml 中
  • 这里就不是直接指定 server 地址了,而是 server 的应用名(spring.application.name)
  • 从注册中心的 server 中读取 dev(开发)环境的配置文件信息
  • 注意此处配置注册中心地址的端口为 8761 也就是上面注册中心工程配置的端口

client- controller 前端控制器

package com.zwc.client.controller;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.WEB.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
    @Value("${hello}")
    private String hello;
    
    @RequestMapping("/hello")
    public String hello() {
        return this.hello;
    }
}

直接使用@Value 注解就可以从注册中心的server 中读取到对应的配置信息

client- 启动类

package com.zwc;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
@SpringBootApplication
@EnableEurekaClient
public class SpringcloudConfigEurekaClientServiceApplication {
    public static void main(String[] args) {
        SpringApplication.run(SpringcloudConfigEurekaClientServiceApplication.class, args);
    }
}

添加 @EnableEurekaClient 注解表示此工程可以向注册中心提供服务

client- 启动项目

1.项目启动成功后访问:http://localhost:8761/(注册中心)可以看到服务已经被注册进来了

2.访问地址:http://localhost:8002/hello

3. 输出内容:‘I’m dev.’

4. 证明 client 已经成功从注册中心的 server 中读取到了配置信息

5. 此时当 client 已经启动完毕后,配置文件就已经全部读取到了,所以即使停止其中一个 server 或者停止

全部 server,client 依然可以读取到配置文件。此处高可用应该是指在 client 启动时能保证有 server 可用

service 工程 -项目结构

把多工程项目使用 IntelliJ IDEA 打开

  • 把项目从 GitHub 中下载到你的本地
  • 打开IntelliJ IDEA
  • 点击 File -> Open
  • 打开你下载到本地的项目目录
  • springcloud-config-eureka ->springcloud-config-eureka-service(选择打开此工程)
  • 打开 service 工程后
  • 再次点击 File -> Project Structrue
  • 选择 Modules,点击 ‘+’ 符号
  • 点击 ImportModule
  • 还是打开你下载到本地的项目目录
  • springcloud-config-eureka ->springcloud-config-eureka-commons -> pom.xml
  • 点击 OK
  • 点击 Next,Finish
  • 点击 Apply,OK

希望能够帮助到你

到此这篇关于SpringCloud之配置中心Config(高可用)的文章就介绍到这了,更多相关SpringCloud配置中心Config内容请搜索编程网以前的文章或继续浏览下面的相关文章希望大家以后多多支持编程网!

--结束END--

本文标题: SpringCloud高可用配置中心Config详解

本文链接: https://www.lsjlt.com/news/147490.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • SpringCloud高可用配置中心Config详解
    目录前言源码环境开发工具正文commons 工程commons 工程 - POM 文件commons 工程 - 项目结构配置文件service 工程registry-service(...
    99+
    2024-04-02
  • SpringCloud微服务应用config配置中心详解
    目录前言一、传统应用配置痛点二、Config 配置中心介绍三、服务端Config Server搭建1.pom依赖2.application启动类配置3.application.yml...
    99+
    2024-04-02
  • SpringCloud之Config配置中心与Redis分布式锁详解
    目录1.服务配置中心1.1 服务配置中心介绍1.2 Nacos Config 实践1.2.1 Nacos config入门案例 1.2.2  Nacos 配置动态...
    99+
    2023-05-20
    SpringCloud Config配置中心 Redis分布式锁
  • SpringCloud分布式微服务云架构 第七篇: 高可用的分布式配置中心(Config)
    上一篇文章讲述了一个服务如何从配置中心读取文件,配置中心如何从远程git读取配置文件,当服务实例很多时,都从配置中心读取文件,这时可以考虑将配置中心做成一个微服务,将其集群化,从而达到高可用,架构图如下:一、准备工作继续使用上一篇文章的工程...
    99+
    2023-06-05
  • SpringCloud Config使用配置方法
    Config 介绍 Spring Cloud Config项目是一个解决分布式系统的配置管理方案。它包含了Client和Server两个部分,server提供配置文件的存储、以接口...
    99+
    2024-04-02
  • SpringCloud Config的使用和配置方法
    这篇文章主要介绍“SpringCloud Config的使用和配置方法”,在日常操作中,相信很多人在SpringCloud Config的使用和配置方法问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Sprin...
    99+
    2023-06-20
  • SpringCloud Config配置中心原理及环境切换方式是什么
    本文小编为大家详细介绍“SpringCloud Config配置中心原理及环境切换方式是什么”,内容详细,步骤清晰,细节处理妥当,希望这篇“SpringCloud Config配置中心原理及环境切换方式是什么”文章能帮助...
    99+
    2023-06-29
  • SpringCloud将Nacos作为配置中心实现流程详解
    目录1、引入依赖2、配置Bootstrap.yml3、配置application.yml4、Controller测试接口在Nacos中添加配置信息匹配规则-理论dataId的完整格式...
    99+
    2022-11-13
    SpringCloud将Nacos作为配置中心 SpringCloud Nacos
  • Springcloud中的Nacos Config服务配置流程分析
    目录简介nacos config快速开始依赖引入配置nacos config启动测试配置动态更新配置简介 前边写过几个微服务,订单微服务,商品微服务,账户微服务,库存微服务,每个微服...
    99+
    2024-04-02
  • SpringCloud高可用服务注册中心Eureka的用法
    这篇文章主要介绍“SpringCloud高可用服务注册中心Eureka的用法”,在日常操作中,相信很多人在SpringCloud高可用服务注册中心Eureka的用法问题上存在疑惑,小编查阅了各式资料,整理出...
    99+
    2024-04-02
  • 【云原生】springcloud13——Config分布式配置中心
    前 言 🍉 作者简介:半旧518,长跑型选手,立志坚持写10年博客,专注于java后端 ☕专栏简介:深入、全面、系统的介绍springcloud与springcloud Alib...
    99+
    2023-09-01
    云原生 分布式 java spring cloud Config
  • SpringCloud安装Nacos完成配置中心
    目录1. Nacos介绍2. docker安装Nacos2.1 docker-compose.yaml2.2 启动后访问控制台3.Springboot集成Nacos3.1 pom依赖...
    99+
    2024-04-02
  • k8s如何部署高可用配置中心apollo
    这篇文章主要讲解了“k8s如何部署高可用配置中心apollo”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“k8s如何部署高可用配置中心apollo”吧!部署...
    99+
    2024-04-02
  • mysql mha高可用配置与详解
    三台mysql网段配置为10.0.0.51 10.0.0.52 10.0.0.53安装mysql1.2.1安装包准备#创建安装包存放目录[root@mysql-db01 ~]# mkdir /home/cc...
    99+
    2024-04-02
  • SpringCloud使用集中配置组件Config规避信息泄露
    目录Spring Cloud Config简介Config实战1、创建项目config服务端2、创建配置文件3、新建启动类4、创建配置中心客户端5、验证总结Spring Cloud ...
    99+
    2024-04-02
  • 如何使用svn+Spring Cloud Config来做配置中心
    这篇文章主要介绍“如何使用svn+Spring Cloud Config来做配置中心”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“如何使用svn+Spring Cloud Config来做配置中心”...
    99+
    2023-06-05
  • SpringCloud分布式微服务云架构 第六篇: 分布式配置中心(Spring Cloud Config)
    一、简介在分布式系统中,由于服务数量巨多,为了方便服务配置文件统一管理,实时更新,所以需要分布式配置中心组件。在Spring Cloud中,有分布式配置中心组件spring cloud config ,它支持配置服务放在配置服务的内存中(即...
    99+
    2023-06-05
  • java怎么配置中心服务化和高可用
    这篇文章主要介绍“java怎么配置中心服务化和高可用”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“java怎么配置中心服务化和高可用”文章能帮助大家解决问题。客户端和服务端的耦合性太高,如果serv...
    99+
    2023-06-05
  • Spring Cloud怎么实现高可用的配置中心
    这篇文章主要为大家展示了“Spring Cloud怎么实现高可用的配置中心”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“Spring Cloud怎么实现高可用的配置中心”这篇文章吧。配置中心如何...
    99+
    2023-06-19
  • SpringCloud使用Zookeeper作为配置中心的示例
    目录相关依赖配置文件application.yml在Zookeeper中创建配置节点和数据 测试类自定义Zookeeper配置 在上一篇文章中介绍了Zookeeper作为注册中心使用...
    99+
    2024-04-02
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作