KubeBlocks
BlogsKubeBlocks Cloud
KubeBlocks for Pulsar

Cluster Management

Create
Scale
Expand volume
Restart
Stop/Start
Delete protection

Configuration

Configure cluster parameters
  1. Steps

Restart a Pulsar cluster

You can restart all pods of the cluster. When an exception occurs in a database, you can try to restart it.

NOTE

The pod role may change after the cluster restarts.

Steps

  1. Restart a cluster.

    kubectl apply -f - <<EOF
    apiVersion: apps.kubeblocks.io/v1alpha1
    kind: OpsRequest
    metadata:
      name: ops-restart
      namespace: demo
    spec:
      clusterRef: mycluster
      type: Restart 
      restart:
      - componentName: bookies
    EOF
    
  2. Check the pod and operation status to validate the restarting.

    kubectl get pod -n demo
    
    kubectl get ops ops-restart -n demo
    >
    NAME          TYPE      CLUSTER     STATUS    PROGRESS   AGE
    ops-restart   Restart   mycluster   Succeed   1/1        3m26s
    

    During the restarting process, there are two status types for pods.

    • STATUS=Terminating: it means the cluster restart is in progress.
    • STATUS=Running: it means the cluster has been restarted.
  1. Configure the values of components and ttlSecondsAfterSucceed and run the command below to restart a specified cluster.

    kbcli cluster restart mycluster -n demo --components="pulsar" --ttlSecondsAfterSucceed=30
    
    • components describes the component name that needs to be restarted.
    • ttlSecondsAfterSucceed describes the time to live of an OpsRequest job after the restarting succeeds.
  2. Validate the restarting.

    Run the command below to check the cluster status to check the restarting status.

    kbcli cluster list mycluster -n demo
    >
    NAME           CLUSTER-DEFINITION   VERSION          TERMINATION-POLICY   STATUS     AGE
    mycluster      pulsar               pulsar-3.0.2     Delete               Running    19m
    
    • STATUS=Updating: it means the cluster restart is in progress.
    • STATUS=Running: it means the cluster has been restarted.

© 2025 ApeCloud PTE. Ltd.