Eureka Server Service Center is the registration of all Eureka Client services to the service center
For example, service A B C is configured as follows:
APPLICATION.YML File configuration:
1 Server:2port:100033 Spring:4 MVC:5 Favicon:6Enabledfalse7 Eureka:8 Client:9 Service:Ten serviceurl: OneDefaultzone:http://127.0.0.1:9998/eureka/ A //This is the configuration file for the service center. - Pagehelper: - Helperdialect:mysql theReasonable:true -Supportmethodsarguments:true -Params:count=Countsql - TG: + sercurity: - Filter: +Includes:/energy/* A excludes:/energy/metering/*,/energy/enterprise/*,/energy/process/*,/energy/processunit/*,/energy/ collectitemconfig/*, at /energy/sys/*,/energy/park/*,/energy/parkenterprise/*,/energy/enengyrate/*,/energy/enengysaving/*,/energy/ enengystandard/*,/energy/analysis/* - DB: - sharding: - path:config/sharding.yml - Default:em2_sysbase - Customname:em2_sysbase in em2_sysbase: - DriverClassName:com.mysql.jdbc.Driver to url:jdbc:mysql://192.168.1.64:3306/em2_sysbase?useunicode=true&characterencoding=utf-8& Zerodatetimebehavior=converttonull&allowmultiqueries=true + Username:root - password:123456 the Filters:stat * maxactive:30 $ Initialsize:5Panax Notoginseng minidle:10 - maxwait:60000 the Validationquery:select 1 + testwhileidle:true A poolpreparedstatements:true the maxopenpreparedstatements:100 +
View Code
BOOTSTRAP.YML File configuration:
1 Spring: 2 3 name:em2-energy-Service 4 5 host:127.0.0.16 port:3369
View Code
Service Center YML configuration file
1 Server:2port:9998//This port will be entered when you log in .3 4 Eureka:5 instance:6hostname:127.0.0.17 Client:8Registerwitheureka:false //whether to register to service center by default true9Fetchregistry:falseTen serviceurl: OneDefaultzone:http://${eureka.instance.hostname}:${server.port}/eureka/
View Code
Zuul is a set of routed load balancer fuses and other services
Its yml configuration is as follows:
1 Server:2port:9999//for landing.3 Zuul:4 routes:5 Auth:6Customsensitiveheadsers:true7 sensitiveheaders:8Stripprefix:false9Path:/auth/**Ten Serviceid:em2-auth-service One //path is the URL of the request here will be intercepted through Serviceid into the current service, Serviceid this is the application of the various services Name,stripprefix:false this is the/api to do the filter A Static: - customsensitiveheadsers:true - sensitiveheaders: the Path:/static/** - stripprefix:true - Serviceid:em2-ui - OSS: + Path:/oss/** - URL:http://192.168.1.64: 10010/ + Stripprefix:false A Max: at Host: - connections:500 - Host: - socket-timeout-millis:120000 - connect-timeout-millis:120000 - Eureka: in Client: - Service: to serviceurl: + Defaultzone:http://127.0.0.1: 9998/eureka/ - the # #timeout Config * Hystrix: $ command:Panax Notoginseng Default: - Execution: the Timeout: + Enabled:false A Isolation: the Thread: + timeoutinmilliseconds:120000 - Ribbon: $ readtimeout:120000 $ connecttimeout:120000 - maxautoretries:0 - maxautoretriesnextserver:1 the Eureka: - enabled:true
View Code
Springcloud framework set of process understanding