2016-03-28 23 views
3

Mikro önyükleme geliştirmeyi bahar önyüklemesi ve netflix oss ile öğrenmeye çalışıyorum.Spring Boot Eureka sunucusu gösterge paneli hatası

İki gün boyunca bu eureka kontrol panelinde hatayla karşılaştım ve düzeltmek mümkün görünmüyor. lütfen yardım et. Tek bir keşif istemci örneği olması ve sunucu bağımsız modda İşte This is how the dashboard looks like

içindedir

package com.example; 

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

@SpringBootApplication 
@EnableEurekaServer 

public class EurekaApplication { 

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

conf application.yml

server: 
    port: 8761 

eureka: 
    instance: 
    hostname: localhost 
    client: 
    registerWithEureka: false 
    fetchRegistry: false 
    serviceUrl: 
    defaultZone: ${eureka.instance.hostname}:${server.port}/eureka/ 
    server: 
     waitTimeInMsWhenSyncEmpty: 0 

bootstrap.yml dosyaları sunucu ana sınıftır

pom.xml

<?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"> 
    <modelVersion>4.0.0</modelVersion> 

    <groupId>com.example</groupId> 
    <artifactId>demo</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 
    <packaging>jar</packaging> 

    <name>EurekaApplication</name> 
    <description>Demo project for Spring Boot</description> 

    <parent> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-parent</artifactId> 
     <version>1.3.3.RELEASE</version> 
     <relativePath/> <!-- lookup parent from repository --> 
    </parent> 

    <properties> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
     <java.version>1.8</java.version> 
    </properties> 

    <dependencies> 
     <dependency> 
      <groupId>org.springframework.cloud</groupId> 
      <artifactId>spring-cloud-starter-eureka-server</artifactId> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-web</artifactId> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-test</artifactId> 
      <scope>test</scope> 
     </dependency> 
    </dependencies> 

    <dependencyManagement> 
     <dependencies> 
      <dependency> 
       <groupId>org.springframework.cloud</groupId> 
       <artifactId>spring-cloud-dependencies</artifactId> 
       <version>Brixton.RC1</version> 
       <type>pom</type> 
       <scope>import</scope> 
      </dependency> 
     </dependencies> 
    </dependencyManagement> 

    <build> 
     <plugins> 
      <plugin> 
       <groupId>org.springframework.boot</groupId> 
       <artifactId>spring-boot-maven-plugin</artifactId> 
      </plugin> 
     </plugins> 
    </build> 

    <repositories> 
     <repository> 
      <id>spring-snapshots</id> 
      <name>Spring Snapshots</name> 
      <url>https://repo.spring.io/snapshot</url> 
      <snapshots> 
       <enabled>true</enabled> 
      </snapshots> 
     </repository> 
     <repository> 
      <id>spring-milestones</id> 
      <name>Spring Milestones</name> 
      <url>https://repo.spring.io/milestone</url> 
      <snapshots> 
       <enabled>false</enabled> 
      </snapshots> 
     </repository> 
    </repositories> 

</project> 
+0

yerine bahar bulutunun birinin yay çizme ebeveyn pom kullanmak için bir sebep var mı? –

+0

@XtremeBiker Projeyi oluşturmak için spring initializr kullandım, sorunun kaynağı bu olabilir mi? –

+0

Bilmiyorum, ama denemeliyim. Ayrıca şu anda beta aşamasında olan Brixton sürümünü kullanıyorsunuz. Onun yerine Angel ile deneyebilirsin. Her neyse, Brixton'la her türlü sorunu Bahar adamlarına bildirmek iyi olur. –

cevap

0

sorun benim application.yml dosya serviceUrl özellik değeri bir yazım hatası vardı ile oldu. Ben http unuttum: // eureka.instance.hostname İşte

önce tamir yaml

eureka: 
    instance: 
    hostname: localhost 
    client: 
    registerWithEureka: false 
    fetchRegistry: false 
    serviceUrl: 
    defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/ 
    server: 
     waitTimeInMsWhenSyncEmpty: 0 

olan O Brixton.RC1

0

yay eklemek gerek yok bir sorun değildi sürüm olarak kullandığınız bağımlılık olarak dönüm noktası.Yalnızca M versiyonu kullandığınızda kullanılır.Ayrıca daha fazla ayrıntı için bahar önyükleme resmi dokümanı.İşleminiz iyi görünüyor.İşlemi gerçekleştirdiğiniz hatayı belirtin. ve .yml dosya hangi işleri kullanıyorum .:

http://maven.apache.org/xsd/maven-4.0.0.xsd "> 4.0.0 org.springframework.samples.service.service microservice-demo 1.1.0.RELEASE kavanoz

<parent> 
    <groupId>org.springframework.cloud</groupId> 
    <artifactId>spring-cloud-starter-parent</artifactId> 
    <version>Brixton.RELEASE</version> 
</parent> 

<properties> 
    <!-- Stand-alone RESTFul application for testing only --> 
    <start-class>io.pivotal.microservices.services.Main</start-class> 
</properties> 

<dependencies> 
    <dependency> 
     <!-- Setup Spring Boot --> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter</artifactId> 
    </dependency> 

    <dependency> 
     <!-- Setup Spring MVC & REST, use Embedded Tomcat --> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-web</artifactId> 
    </dependency> 

    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-thymeleaf</artifactId> 
    </dependency> 

    <dependency> 
     <!-- Setup Spring Data common components --> 
     <groupId>org.springframework.data</groupId> 
     <artifactId>spring-data-commons</artifactId> 
    </dependency> 

    <dependency> 
     <!-- Testing starter --> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-test</artifactId> 
    </dependency> 

    <dependency> 
     <!-- Setup Spring Data JPA Repository support --> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-data-jpa</artifactId> 
    </dependency> 

    <dependency> 
     <!-- In-memory database for testing/demos --> 
     <groupId>org.hsqldb</groupId> 
     <artifactId>hsqldb</artifactId> 
    </dependency> 

    <dependency> 
     <!-- Spring Cloud starter --> 
     <groupId>org.springframework.cloud</groupId> 
     <artifactId>spring-cloud-starter</artifactId> 
    </dependency> 

    <dependency> 
     <!-- Eureka service registration --> 
     <groupId>org.springframework.cloud</groupId> 
     <artifactId>spring-cloud-starter-eureka-server</artifactId> 
    </dependency> 
</dependencies> 

<build> 
    <plugins> 
     <plugin> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-maven-plugin</artifactId> 
      <executions> 
       <execution> 
        <goals> 
         <goal>repackage</goal> 
        </goals> 
       </execution> 
      </executions> 
     </plugin> 
    </plugins> 
</build> 

yapılandır bu Keşif Sunucusu

eureka: örneği: hostname: localhost istemci: # değil bir istemci kendinekayıt yokregisterWithEureka: false fetchRegistry: false

server: 
    port: 1111 # HTTP (Tomcat) port 

# Discovery Server Dashboard uses FreeMarker. Don't want Thymeleaf  templates 
spring: 
    thymeleaf: 
    enabled: false  # Disable Thymeleaf