spring cloud 之eureka-server
来源:互联网 发布:福建公安便民网络 编辑:程序博客网 时间:2024/06/05 01:55
1.pom.xml
<?xml version="1.0"?><project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.djl.springcloud</groupId> <artifactId>spring-cloud-demo</artifactId> <version>0.0.1-SNAPSHOT</version> </parent> <artifactId>eureka-server</artifactId> <name>eureka-server</name> <url>http://maven.apache.org</url> <properties> </properties> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-eureka</artifactId> </dependency> <!--表示为web工程--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <!--暴露各种指标--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-eureka-server</artifactId> </dependency> </dependencies></project>
2./eureka-server/src/main/resources/application.properties
server.port=8761eureka.client.serviceUrl.defaultZone=http://localhost:${server.port}/eureka/eureka.client.registerWithEureka=falseeureka.client.fetchRegistry=false
3.main入口
package com.djl.springcloud.eureka.server;import org.springframework.boot.autoconfigure.SpringBootApplication;import org.springframework.boot.builder.SpringApplicationBuilder;import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;@EnableEurekaServer@SpringBootApplicationpublic class ServerApplication { public static void main(String[] args) { new SpringApplicationBuilder(ServerApplication.class).web(true).run(args); }}4.启动成功日志
2017-07-29 21:53:33.958 INFO 11640 --- [ main] o.s.c.support.DefaultLifecycleProcessor : Starting beans in phase 02017-07-29 21:53:33.962 INFO 11640 --- [ main] c.n.e.EurekaDiscoveryClientConfiguration : Registering application unknown with eureka with status UP2017-07-29 21:53:33.963 INFO 11640 --- [ Thread-10] o.s.c.n.e.server.EurekaServerBootstrap : Setting the eureka configuration..2017-07-29 21:53:33.964 INFO 11640 --- [ Thread-10] o.s.c.n.e.server.EurekaServerBootstrap : Eureka data center value eureka.datacenter is not set, defaulting to default2017-07-29 21:53:33.964 INFO 11640 --- [ Thread-10] o.s.c.n.e.server.EurekaServerBootstrap : Eureka environment value eureka.environment is not set, defaulting to test2017-07-29 21:53:33.988 INFO 11640 --- [ Thread-10] o.s.c.n.e.server.EurekaServerBootstrap : isAws returned false2017-07-29 21:53:33.989 INFO 11640 --- [ Thread-10] o.s.c.n.e.server.EurekaServerBootstrap : Initialized server context2017-07-29 21:53:33.989 INFO 11640 --- [ Thread-10] c.n.e.r.PeerAwareInstanceRegistryImpl : Got 1 instances from neighboring DS node2017-07-29 21:53:33.989 INFO 11640 --- [ Thread-10] c.n.e.r.PeerAwareInstanceRegistryImpl : Renew threshold is: 12017-07-29 21:53:33.989 INFO 11640 --- [ Thread-10] c.n.e.r.PeerAwareInstanceRegistryImpl : Changing status to UP2017-07-29 21:53:34.007 INFO 11640 --- [ Thread-10] e.s.EurekaServerInitializerConfiguration : Started Eureka Server2017-07-29 21:53:34.247 INFO 11640 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8761 (http)2017-07-29 21:53:34.250 INFO 11640 --- [ main] c.n.e.EurekaDiscoveryClientConfiguration : Updating port to 87612017-07-29 21:53:34.258 INFO 11640 --- [ main] c.d.s.eureka.server.ServerApplication : Started ServerApplication in 23.088 seconds (JVM running for 24.651)2017-07-29 21:54:33.991 INFO 11640 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms2017-07-29 21:55:33.993 INFO 11640 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 1ms
5.访问 http://localhost:8761/
能看到上面的页面~成功 OK
阅读全文
0 0
- spring cloud 之eureka-server
- spring cloud之Eureka Server环境搭建
- spring cloud之eureka
- spring cloud eureka server HA
- spring cloud eureka server 配置
- spring cloud eureka-server搭建
- Spring Cloud之Eureka Server高可用集群学习
- spring-cloud-eureka-server之spring-cloud-1.3.4(Dalston.SR3)-boot(1.5.6) 学习笔记
- spring cloud中启动Eureka Server
- Spring Cloud Eureka Server HA With Docker
- spring cloud eureka server warning EUREKA MAY BE INCORRECTLY
- spring cloud服务发现之Eureka
- Spring Cloud之Eureka集群搭建
- spring cloud放弃系列之--2-eureka
- Spring Cloud Netflix之Eureka Doc Translation
- Spring Cloud Netflix之Eureka Client Configuration
- 集群之 -- spring cloud eureka 集群代码
- Spring Cloud 之 Spring Cloud Eureka(四)
- android实现N滴雨(采用onTouchEvent触摸事件和线程)
- hdu 2055 An easy problem
- C语言——实例013 水仙数
- 程序猿生活大爆炸
- hdu 2057 A + B Again
- spring cloud 之eureka-server
- 一些题
- 7.约束
- bzoj2434 阿狸的打字机 fail树+树状数组
- pandas官方文档中cookbook(2)的split&building criteria翻译
- 基于pycaffe从零开始写mnist(第三篇)——生成deploy.prototxt,做最后的验证
- 多种方法实现多态!!!
- WebSacrab与SQL注入
- [ifrog] Round #19 B -- Buildings