• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

SpringCloud-Eureka-服务对应的的名字和ip地址配置显示

武飞扬头像
qq_25243147
帮助1

一、修改支付模块8001、8002的yml文件

(1)8001

学新通

server:
  port: 8001

spring:
  application:
    name: cloud-payment-service
  datasource:
    type: com.alibaba.druid.pool.DruidDataSource
    driver-class-name: org.gjt.mm.mysql.Driver
    url: jdbc:mysql://localhost:3306/springcloud?useUnicode=true&characterEncoding=utf-8&useSSL=false
    username: root
    password: wsh666

mybatis:
  mapperLocations: classpath:mapper/*.xml
  type-aliases-package: com.wsh.springcloud.entity

eureka:
  client:
#    客户端设置为true
    register-with-eureka: true
#    客户端设置为true
    fetch-registry: true
    service-url:
#      defaultZone: http://localhost:7001/eureka
      defaultZone: http://eureka1.com:7001/eureka, http://eureka2.com:7002/eureka
  instance:
    instance-id: payment8001
    prefer-ip-address: true
学新通

(2)8002
学新通

server:
  port: 8002

spring:
  application:
    name: cloud-payment-service
  datasource:
    type: com.alibaba.druid.pool.DruidDataSource
    driver-class-name: org.gjt.mm.mysql.Driver
    url: jdbc:mysql://localhost:3306/springcloud?useUnicode=true&characterEncoding=utf-8&useSSL=false
    username: root
    password: wsh666

mybatis:
  mapperLocations: classpath:mapper/*.xml
  type-aliases-package: com.wsh.springcloud.entity

eureka:
  client:
    #    客户端设置为true
    register-with-eureka: true
    #    客户端设置为true
    fetch-registry: true
    service-url:
      #      defaultZone: http://localhost:7001/eureka
      defaultZone: http://eureka1.com:7001/eureka, http://eureka2.com:7002/eureka
  instance:
    instance-id: payment8002
    prefer-ip-address: true
学新通

(3)测试
学新通
学新通
学新通

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /boutique/detail/tanhfeciig
系列文章
更多 icon
同类精品
更多 icon
继续加载