This section describes how to restore the Cassandra and ZooKeeper databases
from the backups created either automatically or manually as described in
Back up TF databases.
Caution
The data backup must be consistent across all systems
because the state of the Tungsten Fabric databases is associated with
other system databases, such as OpenStack databases.
When restoring the data, MOSK stops the
Tungsten Fabric services and recreates the database backends that
include Cassandra, Kafka, and ZooKeeper.
Note
The automated restoration process relies on automated database
backups configured by the Tungsten Fabric Operator. The Tungsten Fabric
data is restored from the backup type specified in the tf-dbBackup
section of the Tungsten Fabric Operator custom resource, or the default
pvc type if not specified. For the configuration details, refer to
Periodic Tungsten Fabric database backups.
Optional. Specify the name of the backup to be used for the
dbDumpName parameter. By default, the latest db-dump is used.
...
Status:
Health: Ready
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal TfDaemonSetsDeleted 18m (x4 over 18m) tf-dbrestore TF DaemonSets were deleted
Normal zookeeperOperatorScaledDown 18m tf-dbrestore zookeeper operator scaled to 0
Normal zookeeperStsScaledDown 18m tf-dbrestore tf-zookeeper statefulset scaled to 0
Normal cassandraOperatorScaledDown 17m tf-dbrestore cassandra operator scaled to 0
Normal cassandraStsScaledDown 17m tf-dbrestore tf-cassandra-config-dc1-rack1 statefulset scaled to 0
Normal cassandraStsPodsDeleted 16m tf-dbrestore tf-cassandra-config-dc1-rack1 statefulset pods deleted
Normal cassandraPVCDeleted 16m tf-dbrestore tf-cassandra-config-dc1-rack1 PVC deleted
Normal zookeeperStsPodsDeleted 16m tf-dbrestore tf-zookeeper statefulset pods deleted
Normal zookeeperPVCDeleted 16m tf-dbrestore tf-zookeeper PVC deleted
Normal kafkaOperatorScaledDown 16m tf-dbrestore kafka operator scaled to 0
Normal kafkaStsScaledDown 16m tf-dbrestore tf-kafka statefulset scaled to 0
Normal kafkaStsPodsDeleted 16m tf-dbrestore tf-kafka statefulset pods deleted
Normal AllOperatorsStopped 16m tf-dbrestore All 3rd party operator's stopped
Normal CassandraOperatorScaledUP 16m tf-dbrestore CassandraOperator scaled to 1
Normal CassandraStsScaledUP 16m tf-dbrestore Cassandra statefulset scaled to 3
Normal CassandraPodsActive 12m tf-dbrestore Cassandra pods active
Normal ZookeeperOperatorScaledUP 12m tf-dbrestore Zookeeper Operator scaled to 1
Normal ZookeeperStsScaledUP 12m tf-dbrestore Zookeeper Operator scaled to 3
Normal ZookeeperPodsActive 12m tf-dbrestore Zookeeper pods active
Normal DBRestoreFinished 12m tf-dbrestore TF db restore finished
Normal TFRestoreDisabled 12m tf-dbrestore TF Restore disabled
Note
If the restoration was completed several hours ago, events may not be
shown with kubectl describe. If so, verify the Status
field and get events using the following command:
After the job completes, it can take around 15 minutes to stabilize
tf-control services. If some pods are still in the CrashLoopBackOff
status, restart these pods manually one by one:
List the tf-control pods:
kubectl-ntfgetpods-lapp=tf-control
Verify that the new pods are successfully spawned.
Verify that no vRouters are connected to only the tf-control
pod that will be restarted.
Restart the tf-control pods sequentially:
kubectl-ntfdeletepodtf-control-<hash>
When the restoration completes, MOSK automatically sets
dbRestoreMode to false in the Tungsten Fabric Operator custom
resource.
Delete the tfdbrestore object from the cluster to be able to perform
the next restoration:
Terminate the configuration and analytics services and stop the database
changes associated with northbound APIs on all systems.
Note
The Tungsten Fabric Operator watches related resources and keeps
them updated and healthy. If any resource is deleted or changed, the
Tungsten Fabric Operator automatically runs reconciling to create
a resource or change the configuration back to the required state.
Therefore, the Tungsten Fabric Operator must not be running during
the data restoration.
Scale the tungstenfabric-operator deployment to 0 replicas:
Do not use the Tungsten Fabric API container used for the backup
file creation. In this case, a session with the Cassandra and ZooKeeper
databases is created once the Tungsten Fabric API service starts but
the Tungsten Fabric configuration services are stopped. The tools for
the data backup and restore are available only in the Tungsten Fabric
configuration API container. Using the steps below, start a blind
container based on the config-api image.
Deploy a pod using the configuration API image obtained in the first
step:
Note
Since MOSK 24.1, if your deployment uses the
cql Cassandra driver, update the value of the
CONFIGDB_CASSANDRA_DRIVER environment variable to cql.