Clustering
One cashier in a shop is a risk. If that cashier is ill, the shop stops selling. A shop with a team of cashiers can keep going when one is away, if the team knows who is working and who takes the next customer. A cluster is that team, made of computers.
6 min read6 মিনিটে পড়া যায় · 7 sections7টি সেকশন · 8 sources8টি সোর্স · updated Nov 2026আপডেট: Nov 2026
Quorum stops split brainকোরাম স্প্লিট ব্রেইন থামায়
Cut the network and see which side keeps the service. Change the cluster size to see when no side does.নেটওয়ার্ক কেটে দিন আর দেখুন কোন পক্ষ সার্ভিস রাখে। ক্লাস্টারের আকার বদলে দেখুন কখন কেউ রাখে না।
You’ll learnআপনি শিখবেন
- What a heartbeat tells the clusterহার্টবিট ক্লাস্টারকে কী জানায়✓
- Why recovery is not instantরিকভারি কেন সাথে সাথে হয় না
- What split brain isস্প্লিট ব্রেইন কী
- How quorum picks one sideকোরাম কীভাবে এক পক্ষ বাছে
- What fencing adds to quorumকোরামের সাথে ফেন্সিং কী যোগ করে
In plain words
A cluster is a group of machines that work together to give one service. The extra machines guard against failures Source 1সোর্স 1. Each machine in the group is a node.
Two designs are common Source 1সোর্স 1:
- Active-passive: one node gives the service. When the working node fails, the second node takes its job Source 1সোর্স 1.
- Active-active: the nodes work at the same time, and the data must be available on all of them at once Source 4সোর্স 4. The cluster can run many copies of a service to spread the work Source 1সোর্স 1.
The move from a failed node to a working node is failover. In a Pacemaker test, the engineers stop the cluster software on the node that runs a service. The service then starts on the other node, and the failover is automatic Source 3সোর্স 3.
Kubernetes is also a cluster. It has a control plane and a set of worker nodes. In production, the control plane usually runs on many computers, to give fault tolerance and high availability Source 6সোর্স 6.
সহজ English
A cluster is a group of machines. They work together to give one service. The extra machines guard against failures Source 1সোর্স 1. Each machine in the group is a node.
Two designs are common Source 1সোর্স 1:
- Active-passive: one node gives the service. If this node fails, the second node takes its job Source 1সোর্স 1.
- Active-active: the nodes work at the same time. The data must be available on all of them at once Source 4সোর্স 4. The cluster can run many copies of a service to share the work Source 1সোর্স 1.
Failover is the move from a failed node to a working node. In a Pacemaker test, the engineers stop the cluster software on the node that runs a service. The service then starts on the other node. The failover is automatic Source 3সোর্স 3.
Kubernetes is also a cluster. It has a control plane and worker nodes. In production, the control plane usually runs on many computers. This gives fault tolerance and high availability Source 6সোর্স 6.
বাংলা ব্যাখ্যা
ক্লাস্টার (cluster) হলো একদল মেশিন, যারা একসাথে কাজ করে একটি সার্ভিস দেয়। বাড়তি মেশিনগুলো ফেইলিউর থেকে সুরক্ষা দেয় Source 1সোর্স 1। দলের প্রতিটি মেশিন হলো একটি নোড (node)।
দুটি ডিজাইন সাধারণ Source 1সোর্স 1:
- অ্যাকটিভ-প্যাসিভ (active-passive): একটি নোড সার্ভিস দেয়। এই নোড ফেইল করলে দ্বিতীয় নোড তার কাজ নিয়ে নেয় Source 1সোর্স 1।
- অ্যাকটিভ-অ্যাকটিভ (active-active): নোডগুলো একই সময়ে কাজ করে। ডেটা একই সময়ে সব নোডে পাওয়া যাওয়া দরকার Source 4সোর্স 4। কাজ ভাগ করার জন্য ক্লাস্টার একটি সার্ভিসের অনেক কপি চালাতে পারে Source 1সোর্স 1।
ফেইলওভার (failover) হলো ফেইল হওয়া নোড থেকে কাজ করা নোডে সার্ভিস সরে যাওয়া। একটি Pacemaker টেস্টে ইঞ্জিনিয়াররা যে নোডে সার্ভিস চলছে সেখানে ক্লাস্টার সফটওয়্যার বন্ধ করেন। তখন সার্ভিস অন্য নোডে শুরু হয়। ফেইলওভার নিজে থেকেই হয় Source 3সোর্স 3।
Kubernetes-ও একটি ক্লাস্টার। এতে একটি কন্ট্রোল প্লেন (control plane) এবং ওয়ার্কার নোড থাকে। প্রোডাকশনে কন্ট্রোল প্লেন সাধারণত অনেক কম্পিউটারে চলে। এতে ফল্ট টলারেন্স (fault tolerance) এবং হাই অ্যাভেইলেবিলিটি (high availability) পাওয়া যায় Source 6সোর্স 6।
When you need it
You need a cluster when one machine is a single point of failure, and downtime costs too much. The redundancy of many machines keeps the service available when a machine fails Source 1সোর্স 1. It costs more machines, more settings, and more things to test.
সহজ English
You need a cluster when one machine is a single point of failure and downtime costs too much. Many machines give redundancy, so the service stays available when one machine fails Source 1সোর্স 1. The price is more machines, more settings, and more things to test.
বাংলা ব্যাখ্যা
একটি মেশিন যখন সিঙ্গেল পয়েন্ট অফ ফেইলিউর (single point of failure), আর ডাউনটাইমের খরচ অনেক বেশি, তখন ক্লাস্টার দরকার হয়। অনেক মেশিন রিডান্ডেন্সি (redundancy) দেয়, তাই একটি মেশিন ফেইল করলেও সার্ভিস পাওয়া যায় Source 1সোর্স 1। এর দাম হলো বেশি মেশিন, বেশি সেটিং এবং বেশি টেস্ট।
How it works
Alive nodes. The cluster must know which nodes are alive. In Kubernetes, each node sends heartbeats. They help the cluster know if a node is available, and act when a node fails Source 7সোর্স 7. If a node cannot be reached, its Ready condition becomes Unknown. By default, Kubernetes waits 5 minutes before it asks for the first Pod eviction Source 7সোর্স 7. So recovery is not always instant.
Split brain. A harder case is a broken network between the nodes. Each side can still run the service, but cannot talk to the other side. This is split brain Source 5সোর্স 5. If the cluster only assumed that silent nodes were down, many copies of one resource could start on different nodes Source 5সোর্স 5. Two hosts with the same IP address send packets at random to one host or the other. For a database or a cluster file system, the damage can be data corruption Source 5সোর্স 5.
Two tools stop split brain:
- Quorum: a group of nodes has quorum when it holds a majority: most of the cluster's nodes are online and in contact in that group. Quorum stops a service from starting on more nodes than wanted Source 3সোর্স 3.
- Fencing (also STONITH): the cluster makes sure a node is really offline before another node uses the data. A node that does not answer may still use the data Source 2সোর্স 2. A common form is to cut the power of the host Source 2সোর্স 2.
5 nodes, the network splits:
[ A B C ] X [ D E ]
3 of 5 nodes 2 of 5 nodes
has quorum no quorum
keeps working does not start the serviceQuorum example. The picture follows the example of the Pacemaker docs: a 5-node cluster that splits into 3 and 2 nodes. The 3 nodes keep quorum Source 3সোর্স 3. In a 6-node cluster that splits into 3 and 3, neither side has quorum, and by default Pacemaker stops all resources Source 3সোর্স 3.
সহজ English
The cluster must know which nodes are alive. In Kubernetes, each node sends heartbeats. They help the cluster know if a node is available. They also help the cluster act when a node fails Source 7সোর্স 7. If the cluster cannot reach a node, the Ready condition of the node becomes Unknown. By default, Kubernetes waits 5 minutes before it asks for the first Pod eviction Source 7সোর্স 7. So recovery is not always instant.
A harder case is a broken network between the nodes. Each side can still run the service, but it cannot talk to the other side. This is split brain Source 5সোর্স 5. Suppose the cluster only assumed that silent nodes were down. Then many copies of one resource could start on different nodes Source 5সোর্স 5. Two hosts with the same IP address send packets at random to one host or the other. For a database or a cluster file system, the damage can be data corruption Source 5সোর্স 5.
Two tools stop split brain:
- Quorum: a group of nodes has quorum when it holds a majority. This means that most of the cluster's nodes are online and in contact in that group. Quorum stops a service from starting on more nodes than wanted Source 3সোর্স 3.
- Fencing (also STONITH): the cluster makes sure a node is really offline before another node uses the data. A node that does not answer may still use the data Source 2সোর্স 2. A common form is to cut the power of the host Source 2সোর্স 2.
Example from the Pacemaker docs: a 5-node cluster splits into 3 nodes and 2 nodes. The 3 nodes keep quorum Source 3সোর্স 3. A 6-node cluster splits into 3 and 3. Neither side has quorum, and by default Pacemaker stops all resources Source 3সোর্স 3.
বাংলা ব্যাখ্যা
কোন নোড জীবিত আছে, ক্লাস্টারকে তা জানতে হয়। Kubernetes-এ প্রতিটি নোড হার্টবিট (heartbeat) পাঠায়। এগুলো ক্লাস্টারকে জানায় নোড পাওয়া যাচ্ছে কি না, এবং নোড ফেইল করলে ক্লাস্টারকে পদক্ষেপ নিতে সাহায্য করে Source 7সোর্স 7। ক্লাস্টার কোনো নোডে পৌঁছাতে না পারলে সেই নোডের Ready কন্ডিশন হয় Unknown। ডিফল্ট হিসেবে Kubernetes প্রথম Pod এভিকশন (eviction) চাওয়ার আগে 5 মিনিট অপেক্ষা করে Source 7সোর্স 7। তাই রিকভারি সবসময় সাথে সাথে হয় না।
আরও কঠিন অবস্থা হলো নোডগুলোর মাঝের নেটওয়ার্ক ভেঙে যাওয়া। দুই পক্ষই সার্ভিস চালাতে পারে, কিন্তু অন্য পক্ষের সাথে কথা বলতে পারে না। একে বলে স্প্লিট ব্রেইন (split brain) Source 5সোর্স 5। ধরুন ক্লাস্টার শুধু ধরে নিল যে চুপ থাকা নোডগুলো বন্ধ। তখন একটি রিসোর্সের অনেক কপি আলাদা আলাদা নোডে শুরু হতে পারে Source 5সোর্স 5। একই IP অ্যাড্রেসের দুটি হোস্ট এলোমেলোভাবে এক হোস্টে বা অন্য হোস্টে প্যাকেট পাঠায়। ডেটাবেস বা ক্লাস্টার ফাইল সিস্টেমের জন্য ক্ষতি হতে পারে ডেটা করাপশন (data corruption) Source 5সোর্স 5।
স্প্লিট ব্রেইন থামানোর দুটি উপায় আছে:
- কোরাম (quorum): কোনো নোড গোষ্ঠীর হাতে মেজরিটি (majority) থাকলে তার কোরাম আছে। অর্থাৎ ওই গোষ্ঠীতে ক্লাস্টারের বেশিরভাগ নোড অনলাইন এবং পরস্পরের সাথে যোগাযোগে আছে। সার্ভিস যত নোডে চলার কথা, তার চেয়ে বেশি নোডে শুরু হওয়া কোরাম থামায় Source 3সোর্স 3।
- ফেন্সিং (fencing) (STONITH-ও বলে): অন্য নোড ডেটা ব্যবহার করার আগে ক্লাস্টার নিশ্চিত করে যে ওই নোড সত্যিই অফলাইন। যে নোড উত্তর দেয় না সে হয়তো এখনো ডেটা ব্যবহার করছে Source 2সোর্স 2। একটি সাধারণ রূপ হলো হোস্টের পাওয়ার কেটে দেওয়া Source 2সোর্স 2।
Pacemaker ডকুমেন্টেশনের উদাহরণ: 5 নোডের একটি ক্লাস্টার ভেঙে 3 আর 2 নোডের দুই ভাগ হয়। 3 নোডের ভাগ কোরাম রাখে Source 3সোর্স 3। 6 নোডের ক্লাস্টার ভেঙে 3 আর 3 হলে কোনো পক্ষেরই কোরাম থাকে না, এবং ডিফল্ট হিসেবে Pacemaker সব রিসোর্স বন্ধ করে দেয় Source 3সোর্স 3।
A real-life example
This example is the tutorial's own. A learning platform keeps its student data on a database. The team runs two database nodes in active-passive mode. At night, the network switch between them fails. Both nodes are alive but cannot see each other. Without quorum and fencing, the passive node may decide that the first node is dead and start to accept writes. Now two databases take different student results, and nobody can say which one is right. With fencing, the cluster first turns off the other node, and only then starts the service.
Two-node clusters are a special case. One node alone is not more than half of two nodes. Corosync can accept one node as enough for quorum in a two-node cluster. This is safe if fencing is configured Source 3সোর্স 3.
সহজ English
This example is the tutorial's own. A learning platform keeps its student data on a database. The team runs two database nodes in active-passive mode. At night, the network switch between them fails. Both nodes are alive, but they cannot see each other. Without quorum and fencing, the passive node may decide that the first node is dead. It then starts to accept writes. Now two databases take different student results. Nobody can say which one is right. With fencing, the cluster first turns off the other node. Only then does it start the service.
Two-node clusters are a special case. One node alone is not more than half of two nodes. Corosync can accept one node as enough for quorum in a two-node cluster. This is safe if fencing is configured Source 3সোর্স 3.
বাংলা ব্যাখ্যা
এই উদাহরণ টিউটোরিয়ালের নিজের। একটি লার্নিং প্ল্যাটফর্ম তাদের স্টুডেন্টের ডেটা একটি ডেটাবেসে রাখে। টিম দুটি ডেটাবেস নোড অ্যাকটিভ-প্যাসিভ মোডে চালায়। রাতে তাদের মাঝের নেটওয়ার্ক সুইচ ফেইল করে। দুটি নোডই জীবিত, কিন্তু একে অপরকে দেখতে পায় না। কোরাম আর ফেন্সিং না থাকলে প্যাসিভ নোড ভাবতে পারে যে প্রথম নোড মারা গেছে। তখন সে রাইট নেওয়া শুরু করে। এখন দুটি ডেটাবেস আলাদা আলাদা স্টুডেন্ট রেজাল্ট নিচ্ছে, আর কোনটি ঠিক তা কেউ বলতে পারে না। ফেন্সিং থাকলে ক্লাস্টার আগে অন্য নোড বন্ধ করে। তারপরই সার্ভিস শুরু করে।
দুই নোডের ক্লাস্টার একটি বিশেষ ক্ষেত্র। দুই নোডের মধ্যে একটি নোড অর্ধেকের বেশি নয়। তবু Corosync দুই নোডের ক্লাস্টারে একটি নোডকে কোরামের জন্য যথেষ্ট ধরতে পারে। ফেন্সিং কনফিগার করা থাকলে এটি নিরাপদ Source 3সোর্স 3।
Common mistakes
- Turning fencing off. Fencing is on by default. If you turn it off, the cluster pretends that failed nodes are safely off Source 2সোর্স 2.
- Testing only the happy path. A test cluster without fencing cannot test real failure scenarios Source 2সোর্স 2.
- Too few control plane nodes. In a stacked Kubernetes control plane, one failed node takes down both its etcd member and its control plane instance. The docs advise at least three control plane nodes Source 8সোর্স 8.
- Expecting failover to be instant. Kubernetes first marks an unreachable node as
Unknown. After that, by default it waits 5 minutes before it sends the first Pod eviction request Source 7সোর্স 7.
সহজ English
- Turning fencing off. Fencing is on by default. If you turn it off, the cluster pretends that failed nodes are safely off Source 2সোর্স 2.
- Testing only the happy path. A test cluster without fencing cannot test real failure scenarios Source 2সোর্স 2.
- Too few control plane nodes. In a stacked Kubernetes control plane, one failed node takes down both its etcd member and its control plane instance. The docs advise at least three control plane nodes Source 8সোর্স 8.
- Expecting failover to be instant. Kubernetes first marks an unreachable node as
Unknown. After that, by default it waits 5 minutes before it sends the first Pod eviction request Source 7সোর্স 7.
বাংলা ব্যাখ্যা
- ফেন্সিং বন্ধ করা। ফেন্সিং ডিফল্ট হিসেবে চালু থাকে। বন্ধ করলে ক্লাস্টার এমন ভান করে যেন ফেইল হওয়া নোডগুলো নিরাপদে বন্ধ আছে Source 2সোর্স 2।
- শুধু হ্যাপি পাথ টেস্ট করা। ফেন্সিং ছাড়া টেস্ট ক্লাস্টারে আসল ফেইলিউরের অবস্থা টেস্ট করা যায় না Source 2সোর্স 2।
- কন্ট্রোল প্লেন নোড খুব কম। stacked Kubernetes কন্ট্রোল প্লেনে একটি নোড ফেইল করলে তার etcd মেম্বার এবং কন্ট্রোল প্লেন ইনস্ট্যান্স দুটোই বন্ধ হয়। ডকুমেন্টেশন কমপক্ষে তিনটি কন্ট্রোল প্লেন নোডের পরামর্শ দেয় Source 8সোর্স 8।
- ফেইলওভার সাথে সাথে হবে ভাবা। Kubernetes প্রথমে পৌঁছানো যায় না এমন নোডকে
Unknownচিহ্নিত করে। এরপর ডিফল্ট হিসেবে প্রথম Pod এভিকশন রিকুয়েস্ট পাঠানোর আগে 5 মিনিট অপেক্ষা করে Source 7সোর্স 7।
What a tester can check
Tutorial advice
This advice is the tutorial's own. It is not a fact from a source.
- Stop the active node on purpose. Check that the service comes back on another node, and measure how long it takes.
- During failover, send requests all the time. Count the errors and the lost requests.
- Cut the network between two nodes, but keep both nodes running. Check that only one side serves writes, and that no data is lost or doubled.
- Bring the failed node back. Check that it joins again and that the data is the same on all nodes.
- Ask how many nodes the cluster needs for quorum, and test the case where less than half is left.
- Do not test with fencing turned off, because this hides the failures that matter.
সহজ English
This advice is the tutorial's own. It is not a fact from a source.
- Stop the active node on purpose. Check that the service comes back on another node. Measure how long it takes.
- During failover, send requests all the time. Count the errors and the lost requests.
- Cut the network between two nodes, but keep both nodes running. Check that only one side serves writes. Check that no data is lost or doubled.
- Bring the failed node back. Check that it joins again and that the data is the same on all nodes.
- Ask how many nodes the cluster needs for quorum. Test the case where less than half is left.
- Do not test with fencing turned off. This hides the failures that matter.
বাংলা ব্যাখ্যা
এই পরামর্শ টিউটোরিয়ালের নিজের। এটি কোনো সোর্সের তথ্য নয়।
- ইচ্ছা করে অ্যাকটিভ নোড বন্ধ করুন। দেখুন সার্ভিস অন্য নোডে ফিরে আসে কি না। কত সময় লাগে তা মাপুন।
- ফেইলওভারের সময় সবসময় রিকুয়েস্ট পাঠান। এরর আর হারানো রিকুয়েস্ট গুনুন।
- দুটি নোডের মাঝের নেটওয়ার্ক কেটে দিন, কিন্তু দুটি নোডই চালু রাখুন। দেখুন শুধু এক পক্ষ রাইট নেয় কি না। দেখুন কোনো ডেটা হারায় বা দ্বিগুণ হয় কি না।
- ফেইল হওয়া নোড ফিরিয়ে আনুন। দেখুন সে আবার যোগ দেয় কি না এবং সব নোডে ডেটা এক কি না।
- জিজ্ঞাসা করুন কোরামের জন্য ক্লাস্টারে কত নোড লাগে। অর্ধেকের কম নোড বাকি থাকলে কী হয় তা টেস্ট করুন।
- ফেন্সিং বন্ধ রেখে টেস্ট করবেন না। এতে যে ফেইলিউরগুলো গুরুত্বপূর্ণ সেগুলো লুকিয়ে যায়।
Key words
| Word | Meaning |
|---|---|
| Cluster | A group of machines that give one service together |
| Node | One machine in a cluster |
| Active-passive | One node works, the other waits to take over |
| Active-active | Many nodes work at the same time |
| Failover | The move of a service from a failed node to a working node |
| Heartbeat | A signal that a node sends so the cluster knows it is available |
| Quorum | A majority of the cluster's nodes are online together in one group |
| Split brain | Nodes lose contact but each side still runs the service |
| Fencing (STONITH) | Making sure a node is really offline before another node uses the data |