Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Service Registration and Discovery-Eureka (Service Management)

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Introduction to 1.Eureka; Eureka is a tool produced by Netflix to implement service registration and discovery. Spring Cloud integrates Eureka and provides out-of-the-box support. Eureka can be subdivided into Eureka Server and Eureka Client. 1. Eureka is a service discovery framework developed by Netflix. Spring Cloud supports it and integrates it into its own spring-cloud-netflix sub-project. 2. Netflix has opened up many projects on Github, Eureka is just one of them, Netflix open source home page: https://github.com/Netflix 3, Netflix Eureka GitHub open source address: https://github.com/Netflix/eureka. AWS Service registry for resilient mid-tier load balancing and failover. (Eureka is an AWS service registry for elastic middle-tier load balancing and failover) 4. Eureka is a REST (presentation layer state transition)-based service, which is mainly used for AWS (Amazon Web Services- Amazon web Service) cloud location services to achieve load balancing and failover of middle-tier servers. 5. The build requires java8 because of some required libraries that are java8 (servo), but the source and target compatibility are still set to 1.7. (Java JDK 1.8 or above is required to build an Eureka project, because some of the necessary libraries use Java8.) 6. Netflix Eureka official document: https://github.com/Netflix/eureka/wiki, the latest version is V1.9.9 updated on January 11, 2019. 7. The official website of Netflix Eureka was originally version 2.x, but the maintenance of version 2.x was stopped for some reason, but version 1.x is still active and is still actively developing, maintaining, and using; the basic features of 2.Eureka; (1). The basic information object InstanceInfo of the service is generated when the service is started, and then register to the service governance center at startup. (2)。 After registration, all service information is pulled from the service governance center and cached locally. (3)。 After that, the service will be sent a heartbeat message for 30s (configurable) to renew the service. (4)。 If the service governance center does not receive a renewal of a service within 90s, the service will be considered dead and the service registration information will be deleted. (5)。 Before the service stops, the service will actively send a stop request, and the service governance center will delete the information of the service. (6)。 If the heartbeat received by Eureka Server is less than 85% of the normal value (configurable), it will enter self-protection mode, in which Eureka Server will not delete any service information. 3.Eureka principle

Address: https://github.com/Netflix/eureka/wiki/Eureka-at-a-glance4.eureka linux platform service management development script content; #! / bin/bash# configuration information CURDIR=$ (cd $(dirname ${BASH_SOURCE [0]}) Pwd) # remote script call automatically gets the current script path # cd $CURDIRappName=eurekahost=eureka1-dev.comport=8000managementPort=$ {port} appPath= "/ chj/app/eureka/" cluster= http://eureka2-dev.com:8000/eureka, Http://eureka3-dev.com:8000/eurekazone=${cluster}jar="eureka-k8s.jar"memory=512m########################################################### service configuration information logDir= "/ chj/data/log/$ {appName}" mkdir-p ${logDir} source. / script/fn.sh # Environment variable information file # function information function fnstart () {nohup ${CMD} > > ${logDir} / console.log 2 > & 1 & process ID information! Echo ${processId} > ${appPath} / pid echo "startup complete" echo "pid is ${processId}"} function fnstop () {pidfile= "/ chj/app/eureka/pid" processId=$ (cat ${pidfile}) echo "starts to stop service Pid is: ${processId} "kill ${processId} true > ${pidfile} echo" stop done "} function fnrestart () {fnstop fnstart return True} function fstatus () {process=$ (cat ${appPath} / pid) if [[- s ${appPath} / pid]] then echo" True "else echo" flase "fi} # # case $1 in start) fnstart ; stop) fnstop;; restart) fnrestart;; install) fninstall Status) fstatusesaccat. / scriptpacpacpacer fn.shallowOPS = "- server-d64-Xmx$ {memory}-Xms$ {memory}-verbose:gc" JAVA_OPS= "${JAVA_OPS}-XX:+PrintGCDateStamps-XX:+PrintGCTimeStamps" JAVA_OPS= "${JAVA_OPS}-XX:+PrintGCDetails-XX:+PrintTenuringDistribution-XX:+PrintCommandLineFlags-XX:+DisableExplicitGC" JAVA_OPS= "${JAVA_OPS}-XX:+UseConcMarkSweepGC-XX:+UseParNewGC-XX:+CMSParallelRemarkEnabled -Xloggc:$ {logDir} / gc.log "JAVA_OPS=" ${JAVA_OPS}-Djava.security.egd=file:/dev/./urandom "JAVA_OPS=" ${JAVA_OPS}-DappName=$ {appName} "CMD=" java ${JAVA_OPS}-Dhost=$ {host}-Dport=$ {port}-Dcluster=$ {cluster}-Dzone=$ {zone}-jar ${jar}-- spring.profiles.active=peer "

The directory structure is as follows

5. Software package acquisition address:

Https://download.csdn.net/download/u011127348/10628971

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report