SpringEUREKA配置

Posted Legolas

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SpringEUREKA配置相关的知识,希望对你有一定的参考价值。

HDD_EUREKA_SERVER
application.yml

server:
  port: 8101
eureka:
  instance:
    hostname: localhost
  client:
    register-with-eureka: false
    fetch-registry: false
==============================================================
HDD_SHIPPING_SERVICE
application.yml

server:
  port: 8084
logging:
  config: classpath:logback.xml
  level:
    org.springframework: error
    com.ibatis: debug
spring:
  datasource:
    url: jdbc:mysql://10.19.4.16:3306/hdd_yttmb_stp?useUnicode=true&characterEncoding=utf-8
    username: sa
    password: mysql
    type: com.alibaba.druid.pool.DruidDataSource
    druid:
      max-active: 20
      initial-size: 1
      min-idle: 3
      max-wait: 60000
      time-between-eviction-runs-millis: 60000
      min-evictable-idle-time-millis: 300000
      test-while-idle: true
      test-on-borrow: false
      test-on-return: false
mybatis:
  mapperLocations: classpath*:net/huadong/*/*/mapper/*.xml
  configLocation: classpath:mybatis-config.xml
debug: true
——————————————————————————————————————————————————————————————————————————————
bootstrap.yml

spring:
  application:
    name: shippingService
  cloud:
    config:
      enabled: true
      discovery:
        enabled: true
        service-id: config #1
eureka:
  instance:
    non-secure-port: ${server.port:8084}
  client:
    service-url:
      defaultZone: http://${eureka.host:localhost}:${eureka.port:8101}/eureka/
=================================================================================================
HDD_SHIPPING_WEB
application.yml

server:
  port: 80

kaptcha:
  session:
    key: KAPTCHA_SESSION_KEY
  obscurificator:
    impl: com.google.code.kaptcha.impl.ShadowGimpy
  noise:
    impl: com.google.code.kaptcha.impl.NoNoise
  image:
    width: 90
    height: 33
  textproducer:
    font:
      size: 26
      color: black
    char:
      length: 4
      space: 5

  background:
    clear:
      from: 247,247,247
      to: 247,247,247
————————————————————————————————————————————————————————————————————————
bootstrap.yml

spring:
  application:
    name: web

eureka:
  instance:
    non-secure-port: ${server.port:80}
  client:
    service-url:
      defaultZone: http://${eureka.host:localhost}:${eureka.port:8101}/eureka/























































































以上是关于SpringEUREKA配置的主要内容,如果未能解决你的问题,请参考以下文章

Spring Eureka 寻找默认端口 8761 而不是自定义端口

Spring Eureka 服务器在客户端 url 中找不到上下文路径

Spring eureka 仪表板在 Wildfly 上返回 XML

Spring Cloud Eureka Netflix zuul 过滤器

SpringCloud组件之Ribbon深入

无法呈现尤里卡仪表板