服务启动
15:14:57.556 INFO 10 --- [nio-8080-exec-3] c.n.e.registry.AbstractInstanceRegistry : Registered instance FRAMEWORK-GATEWAY/10.10.10.10:framework-gateway with status UP (replication=false)
15:15:00.970 INFO 10 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms
15:15:05.972 INFO 10 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 2ms
- Registered instance <server>/<id> with status UP:表示服务实例已注册到eureka上,状态为up。
- replication=false:是否同步请求,false表示微服务发送的注册请求。
- replication=true:是否同步请求,true表示eureka发送的同步请求。
- Running the evict task with compensationTime 2ms:心跳检查日志。
- 2ms:表示比标准心跳检查时间延时多久,也会用于实例过期时间计算上。这里是心跳检查为5s,两次行调时间15:15:00.970到15:15:05.972,即比5s延时了2ms。。
服务正常关闭
15:16:01.123 INFO 10 --- [io-8080-exec-11] c.n.e.registry.AbstractInstanceRegistry : Registered instance FRAMEWORK-GATEWAY/10.10.10.10:framework-gateway with status DOWN (replication=false)
15:16:05.973 INFO 10 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms
15:16:06.234 INFO 10 --- [nio-8080-exec-5] c.n.e.registry.AbstractInstanceRegistry : Cancelled instance FRAMEWORK-GATEWAY/10.10.10.10:framework-gateway (replication=false)
- Registered instance <server>/<id> with status DOWN:表示服务实例标记为down状态,即不可用。
- Cancelled instance <server>/<id>:表示服务已从注册中心上注销。
服务离线
使用kill -9 pid关闭微服务进程,2分后输出日志。
16:18:41.626 INFO 10 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Evicting 1 items (expired=1, evictionLimit=7)
16:18:41.626 WARN 10 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : DS: Registry: expired lease for FRAMEWORK-GATEWAY/10.10.10.10:framework-gateway
16:18:41.626 INFO 10 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Cancelled instance FRAMEWORK-GATEWAY/10.10.10.10:framework-gateway (replication=false)
-
Evicting 1 items (expired=1, evictionLimit=6):
-
Evicting:expired和evictionLimit中的较小的值,防止一次注销过多的实例。
-
expired:过期的实例数量。
-
evictionLimit:表示一次可过期的数量,防止一次全部过期,避免触发eureka保护机制,值为(eureka上的总实例数*0.15)取整。这里eureka中所有服务的实例数总和为40,计算可得40*0.15=6。
-
-
DS: Registry: expired lease for <server>/<id>:表示为实例心跳过期取消,同时下线。
16:48:38.689 INFO 11 --- [hresholdUpdater] c.n.e.r.PeerAwareInstanceRegistryImpl : Current renewal threshold is : 68
- Current renewal threshold is : 68:表示eureka每分钟最低续约次数,低于68次续约则开启自我保护,不会注销任何服务,为总实例数*0.85,这里为80*0.85=68.
日志级别调整
#eureka日志级别,
logging:
level:
com.netflix: warn #可以减少心跳日志输出