GithubHelp home page GithubHelp logo

Comments (1)

yanghun0070 avatar yanghun0070 commented on July 22, 2024

정상 여부를 확인하기 위해서는 주기적으로 아래 클래스를 통해 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.