1. About Eureka; Eureka is a tool produced by Netflix for 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. Eureka is a service discovery framework developed by Netflix. Spring Cloud supports it and integrates it into its own spring Cloud Netflix subproject. 2. Netflix has opened many projects on Github, Eureka is just one of them. Netflix's open source homepage: https://github.com/Netflix 3. Open source address of Netflix Eureka GitHub: https://github.com/Netflix/eureka. AWS Service registry for resilience mid tier load balancing and failover. Eureka is a kind of service based on REST (presentation layer state transition), which is mainly used in AWS (Amazon Web Services Amazon Web services) cloud location service to achieve load balance and failover of the middle tier server. 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. (build Eureka project requires Java JDK 1 1 1 1.1 1 1 1.7.Above. 8, because some of its necessary libraries use Java 8) 6. Official document of Netflix Eureka: https://github.com/Netflix/eureka/wiki. The latest version is V1.9.9 updated on January 11, 2019. The official website of Netflix Eureka was originally version 2.X. later, for some reasons, the maintenance of version 2.X was stopped. However, version 1.X is still active and is still actively developed, maintained and used.
2. Basic characteristics of Eureka; (1) the basic information object InstanceInfo of the service will be generated when the service is started, and then register to the service governance center when the service is started. (2) after registration, all service information will be 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 the renewal of a service within 90s, it will think that the service has been suspended and delete the service registration information. (5) before the service stops, the service will actively send a stop request, and the service governance center will delete the service information. (6) if the heartbeat packet received by Eureka Server is less than 85% of the normal value (configurable), it will enter the self-protection mode. In this mode, Eureka Server will not delete any service information.
3.Eureka principle
Official website address: https://github.com/Netflix/eureka/wiki/Eureka-at-a-glance
4.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 $CURDIR appName=eureka host=eureka1-dev.com port=8000 managementPort=${port} appPath="/chj/app/eureka/" cluster=http://eureka2-dev.com:8000/eureka,http://eureka3-dev.com:8000/eureka zone=${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 & processId=$! echo ${processId} > ${appPath}/pid echo "Boot up" echo "pid by ${processId}" } function fnstop() { pidfile="/chj/app/eureka/pid" processId=$(cat ${pidfile}) echo "Start stop service, pid by : ${processId}" kill ${processId} true > ${pidfile} echo "Stop over" } 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) fstatus esac cat ./script/fn.sh #!/bin/bash JAVA_OPS="-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. Package access address:
https://download.csdn.net/download/u011127348/10628971