Hands-On Docker for Microservices with Python by Jaime Buelta

Hands-On Docker for Microservices with Python by Jaime Buelta

Author:Jaime Buelta
Language: eng
Format: mobi, epub
Tags: COM048000 - COMPUTERS / Systems Architecture / Distributed Systems and Computing, COM060180 - COMPUTERS / Web / Web Services and APIs, COM051360 - COMPUTERS / Programming Languages / Python
Publisher: Praful Palekar
Published: 2019-11-22T05:55:45+00:00


Check the entries for aws and example in the backend nodes. There is also a lot of interesting information, such as the number of requests, the last connection, data, and so on.

You can perform actions when checking the example backend, and then set state to MAINT in the drop-down menu. Once applied, the example backend is in maintenance mode and removed from the load balancer. The stats page is as follows:

Accessing the load balancer in localhost:8000 now will only return the thoughts frontend. You can re-enable the backend setting it to the READY state.

There's a state called DRAIN that will stop new sessions going to the selected server, but existing sessions will keep going. This may be interesting in some configurations, but if the backend is truly stateless, moving directly to the MAINT state should be enough.

HAProxy can also be configured to use checks to ensure that the backend is available. We added in the example a commented one, which sends an HTTP command to check a return:

option httpchk HEAD / HTTP/1.1\r\nHost:\ example.com

The check will be the same to both backends, so it needs to be returned successfully. By default, it will be run every couple of seconds.

You can check the full HAProxy documentation at http://www.haproxy.org/. There are a lot of details that can be configured. Follow up with your team to be sure that the configuration of areas like timeouts, forwarding headers, and so on are correct.

The concept of the health check is also used in Kubernetes to ensure that pods and containers are ready to accept requests and are stable. We'll see how to ensure that a new image is deployed correctly in the next section.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.