Giter VIP home page Giter VIP logo

Comments (4)

KomachiSion avatar KomachiSion commented on May 20, 2024
  1. 没有问题,既然注册是持久化的服务, 那么在你主动注销之前,肯定是存在在, 至于IP被复用的问题,与nacos无关。
  2. 为何不使用非持久化服务?非持久化服务会在链接断开或超时之后自动移除掉,本身设计出来就是为了类似k8s这样的场景的。

from nacos.

hasaiki123 avatar hasaiki123 commented on May 20, 2024

是的,使用临时实例是一个比较好的选择。但是在k8s环境下,我们如果使用nacos,其实是替代了k8s原生service的服务发现能力,同时service会在pod readiness检查不通过时将ip从endpoint剔除,因此当使用nacos时,我们想利用nacos的http健康检查,检查pod的readiness,当检查不通过时,将实例健康状态之于false,从而匹配了service的能力。显然,只有注册持久化实例才能做到nacos服务端的http健康检查。

from nacos.

hasaiki123 avatar hasaiki123 commented on May 20, 2024

之前我们一直认为使用持久化实例,并配置相关的健康检查是非常不错的选择。

但是最近我们在使用k8s+consul的过程中发现了,ip复用的情况导致服务实例状态显示不正确,而consul的http健康检查也是与nacos持久化实例http健康检查类似,所以有了此issue提问。

导致我们之前使用k8s+nacos持久化实例+preStop的方案有些动摇,而且我们注意到持久化实例如果降为0则一定会触发阈值保护,与我们想的类似service从endpoint中剔除ip有一定差别。

所以,我们现在十分困惑,在k8s中最佳实践是使用临时还是持久化实例?您给出的“临时实例本身设计出来就是为了类似k8s这样的场景的”,是指最佳实践是k8s中使用临时实例吗?

非常期待您能给出建议。

from nacos.

KomachiSion avatar KomachiSion commented on May 20, 2024

临时实例设计就是为了应对如今大多数微服务场景, 例如容器化后的ip频繁变更,扩缩容等问题,不需要额外再让用户通过手段来保证实例个数的准确性和一致性(实际上是通过机制在内部解决了),因此本身临时实例就是大多数场景下的最佳实践。

但是有部分场景其实还是需要持久化服务的,例如类DNS的场景,传统部署服务在上云和微服务化改造过程中,以及不方便引入nacos-client的场景。

from nacos.

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.