一、修改支付模块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)测试
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

更多推荐