springCould 基础服务搭建

gitlab 创建项目

gitlab 或github 创建项目组,并且下载到本地
在这里插入图片描述

  • itoken-eureka 服务注册与发现
  • itoken-config 项目配置
  • itoken-config-respo 项目配置文件存放的位置
  • itoken-zipkin 服务追踪
  • itoken-zuul api网关
  • itoken-admin 服务监控
  • itoken-dependecies pom依赖管理

使用分布式配置中心搭建

这里拿itoken-config 和 itoken-eureka 做解释

# itoken-eureka.yml
spring:
  cloud:
    config:
      name: itoken-eureka
      profile: dev
      uri: http://localhost:8888/
      label: master

这里之前是部署了gitlab的,但是有个坑自己没有解决。就是gitlab上面的项目我无法读取到配置,相同的代码我github就能读取到,暂时还未解决

# itoken-config.yml
spring:
  application:
    name: itoken-config
  cloud:
    config:
      label: master
      server:
        git:
          uri: https://github.com/itoken-test/itoken-config-respo/
          search-paths: respo
          username: 2832799597@qq.com
          password: sjm69362877
#          uri: http://192.168.0.146/itoken/itoken-config-respo.git    #项目名称
#          search-paths: config-repo         #资源文件 文件夹
#          username: 2832799597@qq.com
#          password: xxxx
  zipkin:
    base-url: http://localhost:9411

server:
  port: 8888

eureka:
  client:
    serviceUrl:
      defaultZone: http://localhost:8761/eureka/


# itoken-config-repso 远程git仓库
# itoken-eureka-dev.yml
# 这也是 eureka 真正的配置
spring:
  application:
    name: itoken-eureka

server:
  port: 8761

eureka:
  instance:
    hostname: localhost
  client:
    register-with-eureka: false
    fetch-registry: false
    service-url:
      default-zone: http://${eureka.instance.hostname}:${server.port}/eureka/

本博客只是记录一下,自己在学习分布式配置中心时遇到的坑
还有为何能读到github上的配置,却无法读取自己部署在公司内网上的gitlab上的配置

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值