【问题标题】:Problems getting spring cloud turbine to connect to Eureka让弹簧云涡轮机连接到 Eureka 的问题
【发布时间】:2015-09-16 07:18:54
【问题描述】:

我们正在尝试将涡轮机集成到我们的应用程序中。

我下载了 1.o.o 示例版本 (https://github.com/spring-cloud-samples/turbine/releases/tag/v1.0.0.RELEASE) 并构建并运行了它。我没有连接到 eureka(我在应用程序 yml 中使用相同的 eureka 连接设置的其他服务可以正常连接)。

想也许我应该尝试最新版本的涡轮机 smapel(它使用 Brixton.SNAPSHOT),我添加了 spring 云存储库以获取快照以构建它

<repositories>
        <repository>
            <id>spring-snapshots</id>
            <name>Spring Snapshots</name>
            <url>http://repo.spring.io/libs-snapshot-local</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>spring-milestones</id>
            <name>Spring Milestones</name>
            <url>http://repo.spring.io/libs-milestone-local</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>spring-releases</id>
            <name>Spring Releases</name>
            <url>http://repo.spring.io/release</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>spring-snapshots</id>
            <name>Spring Snapshots</name>
            <url>http://repo.spring.io/libs-snapshot-local</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>spring-milestones</id>
            <name>Spring Milestones</name>
            <url>http://repo.spring.io/libs-milestone-local</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

此版本似乎使用了 2.0.0 版本的涡轮机,我必须为其添加手动依赖项。

结果还是一样,涡轮服务没有连接到尤里卡。

启动时的日志是:

2015-06-30 13:17:47.666  INFO 14120 --- [           main] c.l.vipaas.turbine.TurbineApplication    : Starting TurbineApplication v1.0.0.RELEASE on LARMITCH-M-700M with PID 14120 (/Users/larrymitchell/libertas/vipaas/infrastructureservices/turbine/target/turbine.jar started by larrymitchell in /Users/larrymitchell/libertas/vipaas/infrastructureservices/turbine)
2015-06-30 13:17:47.690 DEBUG 14120 --- [           main] c.l.vipaas.turbine.TurbineApplication    : Running with Spring Boot v1.2.4.RELEASE, Spring v4.1.6.RELEASE
2015-06-30 13:17:48.724  INFO 14120 --- [           main] c.l.vipaas.turbine.TurbineApplication    : Started TurbineApplication in 1.559 seconds (JVM running for 3.093)

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.2.4.RELEASE)

2015-06-30 13:17:54.033  INFO 14120 --- [           main] o.apache.catalina.core.StandardService   : Starting service Tomcat
2015-06-30 13:17:54.036  INFO 14120 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/8.0.23
2015-06-30 13:17:54.257  INFO 14120 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2015-06-30 13:17:57.154  WARN 14120 --- [ost-startStop-1] c.n.c.sources.URLConfigurationSource     : No URLs will be polled as dynamic configuration sources.
2015-06-30 13:17:57.154  INFO 14120 --- [ost-startStop-1] c.n.c.sources.URLConfigurationSource     : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2015-06-30 13:17:57.171  INFO 14120 --- [ost-startStop-1] c.netflix.config.DynamicPropertyFactory  : DynamicPropertyFactory is initialized with configuration sources: com.netflix.config.ConcurrentCompositeConfiguration@63a5621d
2015-06-30 13:18:01.722  WARN 14120 --- [           main] c.n.c.sources.URLConfigurationSource     : No URLs will be polled as dynamic configuration sources.
2015-06-30 13:18:01.723  INFO 14120 --- [           main] c.n.c.sources.URLConfigurationSource     : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2015-06-30 13:18:02.273  INFO 14120 --- [           main] o.apache.catalina.core.StandardService   : Starting service Tomcat
2015-06-30 13:18:02.273  INFO 14120 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/8.0.23
2015-06-30 13:18:02.285  INFO 14120 --- [ost-startStop-1] o.a.c.c.C.[.[localhost].[/manage]        : Initializing Spring embedded WebApplicationContext
2015-06-30 13:18:02.677  INFO 14120 --- [           main] i.reactivex.netty.server.AbstractServer  : Rx server started at port: 8989
2015-06-30 13:18:03.070  INFO 14120 --- [           main] c.l.vipaas.turbine.TurbineApplication    : Started TurbineApplication in 16.006 seconds (JVM running for 17.437

当我查看 Eureka 时,我看不到 Turbine 的任何签入,而我看到其他服务的签入

我还将 netflix 发现日志级别设置为 DEBUG。

【问题讨论】:

  • 日志中有错误吗?您是否在 localhost 上使用默认端口设置了 eureka?
  • 日志很安静。没有异常或错误。我会在帖子中添加内容。我与 eureka 的连接与我的其他服务具有完全相同的连接。他们连接和涡轮不

标签: spring-cloud


【解决方案1】:

好的,我将 eureka 设置移动到 bootstrap,它开始连接到 eureka。如果设置仅在 application.yml 中,则它不会尝试连接。可能有一些深层覆盖。

还有一个关于连接的警告。如果您想让管理端出现在像 spring 云控制台这样的控制台中(请参阅https://github.com/VanRoy/spring-cloud-dashboard),那么您需要注册管理端口而不是 server.port。

【讨论】:

    猜你喜欢
    • 2023-03-22
    • 2019-01-31
    • 2017-01-17
    • 1970-01-01
    • 2015-10-22
    • 2019-01-07
    • 1970-01-01
    • 1970-01-01
    • 2011-05-19
    相关资源
    最近更新 更多