Comments (1)
정상 여부를 확인하기 위해서는 주기적으로 아래 클래스를 통해 new PingUrl(false, "/actuator/health")
에 핑을 보내게 되는데, 해당 url 없기 때문에 에러나는 현상 이므로, spring boot에서 제공되는 actuator url 로 변경 진행
@RibbonClients(defaultConfiguration = RibbonConfiguration.class)
구현 이유?
문제의 원인은 리본은 라운드 로빈 전략으로 구성되고, 상태 체크 메커니즘을 none 으로 설정되어 있습니다.
그러므로, 로드벨런스에서 서비스가 살아있는 지 알 수 없습니다.
유레카가 인스턴스를 등록하고 해지 시키는 시간도 평균 3분 정도 걸립니다.
(leaseRenewalIntervalInSeconds
매개변수를 수정하는 것은 좋지않음 )
리본에defaultConfiguration
을 설정해, 서비스에 핑을 보내고 결과에 따라, 로드벨런싱하는 기능을 추가했습니다.
로드밸런싱 할때 대상 서버의 상태를 확인하고 정상인 경우에만 요청을 보내야 합니다.
public class RibbonConfiguration {
/**
* Returns the {@link IPing} changes the default state checking mechanism
*
* @param config the {@link IClientConfig}
*/
@Bean
public IPing ribbonPing(final IClientConfig config) {
return new PingUrl(false, "/actuator/health");
}
/**
* Returns the {@link IRule} to modify default load balancing strategy
*
* @param config the {@link IClientConfig}
*/
@Bean
public IRule ribbonRule(final IClientConfig config) {
return new AvailabilityFilteringRule();
}
}
from dayco.
Related Issues (20)
- Github, Google, Naver oAuth 제공
- Logout 기능 구현
- Profile 이미지 추가 HOT 2
- HTTP Status Code 에 따라 UI 변경 HOT 1
- UAA Service HTTP Status Code 에 따라 Custom 메시지 정의 HOT 1
- UAA Gateway, Eureka 연결 HOT 1
- Spring Session을 이용한 세션 클러스터링
- Posts 기능 개발 HOT 5
- logback dev, prod 환경 분리
- fontawesome icon 추가
- JWT 토큰 만기 되었을 경우, HTTP Status 500 에러 발생
- JSON 형태의 Response 값에서 Exception 및 Success 할 경우, 공통 Alert 창 띄워지게 수정 HOT 1
- Netflix Zuul 에서 Spring Cloud Gateway 변경 HOT 1
- Netflix Ribbon 에서 Spring Cloud Loadbalancer 로 변경
- JS moment.js 연동 HOT 1
- Kubernetes 추가 HOT 1
- MinIO 오브젝트 스토리지 연동 HOT 1
- Spring JPA MySQL 연동 HOT 2
- 카카오 로그인 및 싱크 기능 추가 HOT 1
- Gradle Multi Module 로 변경 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dayco.