zoukankan      html  css  js  c++  java
  • springcloud:eureka集群配置

    服务器1:

    application.yml配置文件:

     server:
      port: 8777


    eureka:
      instance:
        hostname: EurekaServer8777
      client:
        register-with-eureka: false
        fetch-registry: false
        service-url:
          defaultZone: http://EurekaServer8888.com:8888/eureka/

    依赖文件:

    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <parent>
            <artifactId>microservice_cloud_01</artifactId>
            <groupId>com.offcn</groupId>
            <version>1.0-SNAPSHOT</version>
        </parent>
        <modelVersion>4.0.0</modelVersion>

        <artifactId>microservice_cloud_05_privider_eureka01_8777</artifactId>

        <dependencies>
            <!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-netflix-eureka-server -->
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
                <version>2.1.0.RELEASE</version>
            </dependency>
        </dependencies>

    </project>

    启动类:

    package com.offcn;


    import org.springframework.boot.SpringApplication;
    import org.springframework.boot.autoconfigure.SpringBootApplication;
    import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;

    @SpringBootApplication
    @EnableEurekaServer
    public class AppStarts {

        public static void main(String[] args) {
            SpringApplication.run(AppStarts.class,args);
        }
    }

    服务器二:

    application.yml配置文件:

     server:
      port: 8777


    eureka:
      instance:
        hostname: EurekaServer8888
      client:
        register-with-eureka: false
        fetch-registry: false
        service-url: 
          defaultZone: http://EurekaServer8777.com:8777/eureka/

    依赖文件:

    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <parent>
            <artifactId>microservice_cloud_01</artifactId>
            <groupId>com.offcn</groupId>
            <version>1.0-SNAPSHOT</version>
        </parent>
        <modelVersion>4.0.0</modelVersion>

        <artifactId>microservice_cloud_06_privider_eureka01_8888</artifactId>

        <dependencies>
            <!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-netflix-eureka-server -->
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
                <version>2.1.0.RELEASE</version>
            </dependency>
        </dependencies>

    </project>

    启动类:

    package com.offcn;


    import org.springframework.boot.SpringApplication;
    import org.springframework.boot.autoconfigure.SpringBootApplication;
    import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;

    @SpringBootApplication
    @EnableEurekaServer
    public class AppStart {

        public static void main(String[] args) {
            SpringApplication.run(AppStart.class,args);
        }
    }

  • 相关阅读:
    字符串混淆技术应用 设计一个字符串混淆程序 可混淆.NET程序集中的字符串
    运用Mono.Ceci类库修改.NET程序集 走上破解软件的道路
    字符串反混淆实战 Dotfuscator 4.9 字符串加密技术应对策略
    数学:《初等书论》素数与合数
    数学:《线性代数》矩阵乘积 之 代码实现
    数学:《线性代数》方阵求逆 之 代码实现
    数学:《线性代数》矩阵运算
    数学:《线性代数》矩阵初等行变换及其应用(线性方程求解)
    数学:《概率》条件概率公式
    Entityframework:启用延时加载的主意事项(只为强化记忆)
  • 原文地址:https://www.cnblogs.com/wycBolg/p/11816937.html
Copyright © 2011-2022 走看看