springcloud微服务学习笔记目录:
springcloud微服务学习笔记
1.修改8001yml文件
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/db2019?useUnicode=true&characterEncoding=utf-8&useSSL=false
username: root
password: root
mybatis:
type-aliases-package: com.atguigu.springcloud.entities
mapper-locations: classpath:mapper/*.xml
eureka:
client:
#表示是否将自己注册进eurekaServer 默认为true
register-with-eureka: true
#是否从eurekaServer抓取已有的注册信息,默认为true,单节点无所谓,集群必须设置为true才能配合ribbon使用负载均衡
fetch-registry: true
service-url:
# defaultZone: http://localhost:7001/eureka
defaultZone: http://eureka7001.com:7001/eureka/,http://eureka7002.com:7002/eureka/
2.修改80ymlwe文件
server:
port: 80
spring:
application:
name: cloud-order-service
eureka:
client:
#表示是否将自己注册进eurekaServer 默认为true
register-with-eureka: true
fetch-registry: true
service-url:
#defaultZone: http://localhost:7001/eureka/
defaultZone: http://eureka7001.com:7001/eureka/,http://eureka7002.com:7002/eureka/
3.测试
地址:http://localhost/consumer/payment/get/1