美文网首页
2020-07-01---创建集群版的eureka

2020-07-01---创建集群版的eureka

作者: 李霖神谷 | 来源:发表于2020-07-01 13:46 被阅读0次

    1.怎么搭建集群版的eureka:
    需要在eureka yml文件中配置其它eureka的服务地址。如下7001的服务配置的是7002的地址,7002的服务配置的是7001的地址。相互关联。
    server:
    port: 7001
    spring:
    application:
    name: eureka-cloud-7001
    datasource:
    url: jdbc:mysql://127.0.0.1:3306/cloud?useUnicode=true&characterEncoding=utf8&useSSL=false
    driverClassName: com.mysql.jdbc.Driver
    password: root
    username: root

    eureka:
    instance:
    hostname: eureka-cloud-7001
    client:
    register-with-eureka: false
    fetch-registry: false
    serviceUrl:
    defaultZone: http://eureka-cloud-7002:7002/eureka/
    2.集群版的生产者服务:
    修改host文件模拟多个服务器。修改yml文件,将服务注册到eureka服务中去,
    server:
    port: 7002
    spring:
    application:
    name: eureka-cloud-7002
    datasource:
    url: jdbc:mysql://127.0.0.1:3306/cloud?useUnicode=true&characterEncoding=utf8&useSSL=false
    driverClassName: com.mysql.jdbc.Driver
    password: root
    username: root

    eureka:
    instance:
    hostname: eureka-cloud-7002
    client:
    register-with-eureka: false
    fetch-registry: false
    serviceUrl:
    defaultZone: http://eureka-cloud-7001:7001/eureka/

    相关文章

      网友评论

          本文标题:2020-07-01---创建集群版的eureka

          本文链接:https://www.haomeiwen.com/subject/qtbcqktx.html