Open TomHutter opened 6 years ago
The galera
service is required by the StatefulSet and shall not be used to let clients connect. So creating a second service for client access is the right way to go.
We've also discussed updating the readinessProbe in #8, but didn't yet work on it. A PR with your changes would be very much appreciated.
Hi everybody,
due to the annotation:
service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
in the service, it seems to me, that the service is distributing requests to nodes, even they are not ready. This leads to connection or SQL errors, when client requests are distributed to nodes which are shutting down. Therefore I created another service, which has no annotation and use this service for the clients to connect:Additionally I modified the readiness probe to check for a semaphore file and if the node is in sync:
Then I added a pre_stop command to the stateful set, increased the
terminationGracePeriodSeconds
to 60, to give the nodes enough time to shut down and set the frequency of thereadinessProbe
to 10 seconds:Now the nodes themselves can connect to each other over the
galera-mdb-ga
service, which tolerates not ready nodes and the clients can connect to the nodes overgalera-mdb-ga-service
, which distributes requests only to ready nodes.