VerticaReplicator custom resource definition
The VerticaReplicator custom resource (CR) facilitates in-database replication through the Vertica Kubernetes operator. This feature allows you to create a VerticaReplicator CR to replicate databases for copying data, testing, or performing active online upgrade. It supports replication to and from sandbox environments. Additionally, both password-based authentication and source TLS authentication are supported.
Important
- Vertica only supports replicating all data from a database or sandbox to another database or sandbox. Partial table replication is not supported.
- The version of the target database or sandbox must be the same as or higher than the version of the source database or sandbox.
- Vertica only supports replication for the source database that contains a single namespace.
The VerticaReplicator custom resource (CR) runs replicate on a VerticaDB CR, which copies table or schema data directly from one Eon Mode database's communal storage (source VerticaDB) to another (target VerticaDB).
Prerequisites
- Deploy a source and target VerticaDB CR that uses VerticaDB API version
v1
withvclusterops
. - Deploy a VerticaDB operator version 2.0 and higher.
Create a VerticaReplicator CR
A VerticaReplicator CR spec
only requires the names of the source and target VerticaDB CR for which you want to perform replication. The following example defines the CR as a YAML-formatted file named vreplicate-example.yaml
:
apiVersion: vertica.com/v1beta1
kind: VerticaReplicator
metadata:
name: vreplicator-example
spec:
source:
verticaDB: "vertica-src"
target:
verticaDB: "vertica-trg"
For a complete list of parameters that you can set for a VerticaReplicator CR, see Custom resource definition parameters.
Apply the manifest
After you create the VerticaReplicator CR, apply the manifest in the same namespace as the CR specified by verticaDBName
:
$ kubectl apply -f vreplicator-example.yaml
verticareplicator.vertica.com/vreplicator-example created
The operator starts the replication process and copies the table and schema data from the source VerticaDB to the target VerticaDB.
You can check the applied CRs as follows:
$ kubectl get vrep
NAME SOURCEVERTICADB TARGETVERTICADB STATE AGE
vreplicator-example vertica-src vertica-trg Replicating 2s
Replicating to a sandboxed subcluster
You can replicate from a source db to a sandboxed subcluster.
The following example defines the CR as a YAML-formatted file named vreplicator-trg-sandbox.yaml
:
apiVersion: vertica.com/v1beta1
kind: VerticaReplicator
metadata:
name: vreplicator-trg-sandbox
spec:
source:
verticaDB: "vertica-src"
target:
verticaDB: "vertica-trg"
sandboxName: "sandbox1"
After you apply the manifest, the operator will copy the table and schema data from the source VerticaDB to the sandboxed subcluster “sandbox1” on the target VerticaDB.
Replication status
You can check the replication status as follows:
$ kubectl describe vrep
Name: vreplicator-example
Namespace: vertica
Labels: <none>
Annotations: <none>
API Version: vertica.com/v1beta1
Kind: VerticaReplicator
Metadata:
Creation Timestamp: 2024-07-24T12:34:51Z
Generation: 1
Resource Version: 19058685
UID: be90db7f-3ed5-49c0-9d86-94f87d681806
Spec:
Source:
Vertica DB: vertica-src
Target:
Vertica DB: vertica-trg
Status:
Conditions:
Last Transition Time: 2024-07-24T12:34:51Z
Message:
Reason: Ready
Status: True
Type: ReplicationReady
Last Transition Time: 2024-07-24T12:35:01Z
Message:
Reason: Succeeded
Status: False
Type: Replicating
Last Transition Time: 2024-07-24T12:35:01Z
Message:
Reason: Succeeded
Status: True
Type: ReplicationComplete
State: Replication successful
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal ReplicationStarted 4m3s verticadb-operator Starting replication
Normal ReplicationSucceeded 3m57s verticadb-operator Successfully replicated database in 5s
Conditions
The Conditions
field summarizes each stage of the replication and contains the following fields:
Last Transition Time
: Timestamp that indicates when the status condition last changed.Message
: This field is not in use, you can safely ignore it.Reason
: Indicates why the replication stage is in its currentStatus
.Status
: Boolean, indicates whether the replication stage is currently in process.Type
: The replication that the VerticaDB operator is executing in this stage.
The following table describes each Conditions.Type
, and all possible value combinations for its Reason
and Status
field values:
Type | Description | Status | Reason |
---|---|---|---|
ReplicationReady |
The operator is ready to start the database replication. |
True |
Ready |
False |
Source database or sandbox is running a version earlier than 24.3.0. Target database or sandbox version is lower than the source database or sandbox version. Source database is deployed using admintools. | ||
Replicating |
The operator is replicating the database. |
True |
Started |
False |
| ||
ReplicationComplete |
The database replication is complete. |
True |
Succeeded |