Frage

Wenn ich mehrere Federstiefel-eingebettete Tomcat-Container habe und jeweils Service-Endpunkte wie

haben können generasacodicetagpre.

Wie kann das Lastausgleich mit 2 Micro-Diensten so geladen werden, dass Clients eine der erwähnten URL auf Basierend auf einem beliebigen Lastausgleichsstartegy

treffen können?

Eine Option, die in meinen Gedanken kommt, ist die Verwendung von Netflix-Kurator (oder) einen Apache-Webserver, der als umgekehrter Proxy fungiert, aber mit Apache, wenn Sie neue Instanzen Ihrer Dienste erstellen, haben Sie einen Eintrag dieses Dienstes alsMitglied in httpd.conf

liefert feder boot eine beliebige dienstleistung und lastausgleichsmechanismus?

War es hilfreich?

Lösung

Federstiefel bereitstellt dieses Merkmal nicht, da es normalerweise von einem umgekehrten Proxy bereitgestellt wird, z. B. Apache / Nginx, der vor dem Feder-Boot-Server läuft.

sehen Sie hier ein Beispiel hier, wie die kommerzielle Version von Nginx die Funktionalität von dynamisch bietetSkalieren und Reduzieren der Upstream-Knoten .

In diesem Fall ist es in diesem Fall für die dynamische Instanz, in diesem Fall ist der Federstiefelprozess, um das Anwesenheit / Resiglisten selbst auf dem Upstream-Server bei Initialisierung / Herunterfahren zu signalisieren.

siehe hier , wie Sie dies im Fall von NginX tun, dieses Verfahrenwird von dem Server bis zum Server anders sein.

Andere Tipps

Arguably it's not really an application's role to manage its own load-balancing, and Spring Boot focuses on the implementation of an application (or service, equivalently). We have been thinking about whether we could provide features in Spring (Boot or otherwise) to make it easy to write your own load-balancer, or service registry app, but even then I don't think that was what the question was really about (or was it?).

If I interpret the question, and the example use case, literally, I would say that the most natural answer is an out-of-the-box reverse proxy solution (as the other answers pointed out). I also note that such a reverse proxy is an essential and natural part of a PaaS solution, so if you need it to "just work" and don't want to know about the details, PaaS would be a natural path (e.g. see cloudfoundry as an example of such a solution that I happen to have worked on).

Indeed Spring Boot has not inherit support for load-balancing. Just to add to the list of available solutions for load-balancing, here are the instructions to configure an Apache for load-balancing.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top