Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

StatefulSets fix the master slave architecture Problem:

Sumit Rawal answered on May 6, 2023 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers


StatefulSets fix the master slave architecture Problem:

0

that’s where stateful sets come into play. Stateful sets are similar to deployment sets, as in they create PODs

based on a template. But with some differences.

1.

2. With stateful sets, pods are created in a sequential order.

3. After the first pod is deployed, it must be in a running and ready state before the next pod is deployed.

4. So that helps us ensure master is deployed first and then slave 1 and then slave 2.

Stateful sets assign a unique ordinal index to each POD – a number starting from 0 for the first pod and

increments by 1.

5.

6. Each Pod gets a name derived from this index, combined with the stateful set name.

7. So the first pod gets mysql-0, the second pod mysql-1 and third mysql-2.

8. SO no more random names. You can rely on these names going forward.

9. We can designate the pod with the name mysql-0 as the master, and any other pods as slaves.

Pod mysql-2 knows that it has to perform an initial clone of data from the pod mysql-1. If you scale up by

deploying another pod, mysql-3, then it would know that it can perform a clone from mysql-2.

10.

To enable continuous replication, you can now point the slaves to the master at mysql-0. Even if the master

fails, and the pod is recreated is created, it would still come up with the same name.

11.

12. Stateful sets maintain a sticky identity for each of their pods.

13. The master is now always the master and available at the address mysql-0.

14. And that is why you need stateful sets  

Popularity 1/10 Helpfulness 1/10 Language typescript
Source: Grepper
Link to this answer
Share Copy Link
Contributed on May 06 2023
Sumit Rawal
0 Answers  Avg Quality 2/10


X

Continue with Google

By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
X
Grepper Account Login Required

Oops, You will need to install Grepper and log-in to perform this action.