SpringCould Config 配置中心

SpringCould Config
随着业务的增长和功能的完善,对于springboot 的配置文件 application.properties 或application.yml文件管理越来越困难。为了对springcould 的各个子项目的配置文件统一管理,springcould 提供了config 管理的模块。springcould config 配置中心。

目标:
创建springcloud 配置中心模块,用github 统一管理配置文件。springboot 应用程序通过 springcloud 配置中心模块访问github 的配置文件。

步骤:

  1. 申请和拥有一个github 账号,并在本地安装git 客户端, 在github 上创建一个SpringCloud 的项目,目的是把配置文件提交到此目录的子目录进行统一管理。
    在这里插入图片描述
    2.在本地电脑创建文件夹并把SpringCloud 项目clone 到本地电脑。
    clone 命令: git clone remote url
git clone  https://github.com/Jason954242100/SpringCloud.git

在这里插入图片描述
3.在SpringCloud 文件夹下创建 config_properties文件夹并创建Application相关文件。

在这里插入图片描述
文件的内容为:
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

4.把文件用git 客户端提交到github 。
git 命令 : git add , git commit , git push
在这里插入图片描述
5. 创建config server 模块 SpringBootConfigServer.
5.1 创建一个springboot 项目并在pom 文件中加入config 依赖的支持。
在这里插入图片描述

<?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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值