zoukankan      html  css  js  c++  java
  • springcloud的config

    CONFIG服务端

    加入依赖:

    <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-config-server</artifactId>
            </dependency>

    yml文件配置:

    server:
      port: 3344
    spring:
      application:
        name: microservicecloud-config
      cloud:
        config:
          server:
            git:
              uri: git@github.com:********    #github上面的git仓库的名字

    CONFIG客户端:

    引入依赖

      <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-config</artifactId>
            </dependency>

    yml文件(bootstrap.yml优先级最高)

    spring:
      cloud:
        config:
          name: microservicecloud-config-client   #需要从github上读取资源名称,
          profile: dev      #访问配置项为dev
          label: master
          uri: http://localhost:3344    #去3344号上通过config获取github上的服务地址
    ...
  • 相关阅读:
    mongodb搭建
    使用systemctl管理服务
    常用命令--find
    linux中的常用信号
    bash 中的特殊变量
    tomcat开启PID文件
    django基础入门
    Redis源码编译安装
    DRF路由组件
    Django/DRF序列化
  • 原文地址:https://www.cnblogs.com/javage/p/9493732.html
Copyright © 2011-2022 走看看