免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4534 | 回复: 0
打印 上一主题 下一主题

HongHu云架构 - eureka的相关配置 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2017-10-19 14:28 |只看该作者 |倒序浏览
1.在启动类入口引用eureka的相关配置,代码如下:
package com.ml.honghu;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;@EnableEurekaServer@SpringBootApplicationpublic class ServiceApplication {        public static void main(String[] args) {                SpringApplication.run(ServiceApplication.class, args);        }}2.配置application.yml文件
# server (eureka 默认端口为:8761)server:  port: 8761# springspring:  application:    name: particle-commonservice-erueka# eurekaeureka:   client:     # 是否注册到eureka    register-with-eureka: true    # 是否从eureka获取注册信息    fetch-registry: false    availability-zones:       honghu: honghuZone    service-url:       honghuZone: http://honghu:123456@localhost:8761/eureka/      defaultZone: http://honghu:123456@localhost:8761/eureka/  instance:    prefer-ip-address: true    hostname: localhost    metadataMap:      zone: honghuZone      user: ${security.user.name}      password: {security.user.password}        # 指定环境  environment: dev  #指定数据中心  datacenter: honghu  # 关闭自我保护模式  server:     enable-self-preservation: false  #设置清理无效节点的时间间隔,默认60000,即是60s    eviction-interval-timer-in-ms: 60000# 服务认证security:   basic:     enabled: true  user:     name: honghu    password: 123456management:  security:    enabled: false[url=http://minglisoft.cn/honghu/technology.html]资料和源码来源[/url]
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP