How to stop a cluster deployed with tidb-operator?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 使用tidb-operator部署的集群怎么停止?

| username: TiDBer_c9JpgyU7

[TiDB Usage Environment] Production Environment / Testing / PCO
[TiDB Version] 6.1
[Encountered Problem]
[Reproduction Path] What operations were performed that caused the problem
[Problem Phenomenon and Impact]

[Attachment]

Please provide the version information of each component, such as cdc/tikv, which can be obtained by executing cdc version/tikv-server --version.

| username: TiDBer_c9JpgyU7 | Original post link

Directly setting all replicas to 0 will result in the error “can’t scale in TiKV of TidbCluster [qyxtcs-dev/tidb-test], cause the number of up stores is equal to MaxReplicas in PD configuration(3), and the store in Pod tidb-test-tikv-2 which is going to be deleted is up too.” Can I first set PD’s max-replicas to 0 and then set all replicas to 0 to stop the cluster?

| username: TiDBer_c9JpgyU7 | Original post link

Is there any expert who can help answer this?

| username: songxuecheng | Original post link

Run kubectl delete tc ${cluster_name} -n ${namespace} to destroy the cluster.

| username: TiDBer_c9JpgyU7 | Original post link

After destruction, will the subsequent re-creation still be the original cluster?

| username: TiDBer_c9JpgyU7 | Original post link

If destroyed, the service will also be deleted, and when the service is recreated later, the service IP and other details will change.

| username: songxuecheng | Original post link

Do you want to stop the cluster?

| username: TiDBer_c9JpgyU7 | Original post link

Yes, that’s right.

| username: songxuecheng | Original post link

kubectl patch tc ${cluster_name} -n ${namespace} --type merge -p ‘{“spec”:{“paused”: true}}’

| username: TiDBer_c9JpgyU7 | Original post link

It’s useless, this won’t stop those components.

| username: TiDBer_c9JpgyU7 | Original post link

I have now set paused to true and manually deleted other components, but I am not sure if there are any side effects.

| username: songxuecheng | Original post link

If you just want to stop, this will do.

| username: TiDBer_c9JpgyU7 | Original post link

Okay, thank you.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.