You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/current/v25.2/alter-virtual-cluster.md
+7-8Lines changed: 7 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -15,12 +15,11 @@ The `ALTER VIRTUAL CLUSTER` statement initiates a [_failover_](#start-the-failov
15
15
16
16
## Required privileges
17
17
18
-
`ALTER VIRTUAL CLUSTER`requires one of the following privileges:
18
+
{% include_cached new-in.html version="v25.2" %} To run the `ALTER VIRTUAL CLUSTER`statement from the standby cluster, users require the `REPLICATIONDEST` system [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}) **and** the `MANAGEVIRTUALCLUSTER` privilege.
19
19
20
-
- The `admin` role.
21
-
- The `MANAGEVIRTUALCLUSTER`[system privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#privileges) allows the user to run all the related `VIRTUAL CLUSTER` SQL statements for PCR.
20
+
{% include_cached new-in.html version="v25.2" %} The `ALTER VIRTUAL CLUSTER ... SET REPLICATION SOURCE` statement requires the `REPLICATIONSOURCE` system privilege and the `MANAGEVIRTUALCLUSTER` privilege.
22
21
23
-
Use the [`GRANT SYSTEM`]({% link {{ page.version.version }}/grant.md %}) statement:
22
+
Use the [`GRANT SYSTEM`]({% link {{ page.version.version }}/grant.md %}) statement to grant the necessary privileges:
24
23
25
24
{% include_cached copy-clipboard.html %}
26
25
~~~sql
@@ -42,7 +41,7 @@ Parameter | Description
42
41
`RESUME REPLICATION` | Resume the replication stream.
43
42
`COMPLETE REPLICATION TO` | Set the time to complete the replication. Use: <br><ul><li>`SYSTEM TIME` to specify a [timestamp]({% link {{ page.version.version }}/as-of-system-time.md %}). Refer to [Fail over to a point in time]({% link {{ page.version.version }}/failover-replication.md %}#fail-over-to-a-point-in-time) for an example.</li><li>`LATEST` to specify the most recent replicated timestamp. Refer to [Fail over to a point in time]({% link {{ page.version.version }}/failover-replication.md %}#fail-over-to-the-most-recent-replicated-time) for an example.</li></ul>
44
43
`SET REPLICATION RETENTION = duration` | Change the [duration]({% link {{ page.version.version }}/interval.md %}) of the retention window that will control how far in the past you can [fail over]({% link {{ page.version.version }}/failover-replication.md %}) to.<br><br>{% include {{ page.version.version }}/physical-replication/retention.md %}
45
-
`SET REPLICATION EXPIRATION WINDOW = duration` | Override the default producer job's expiration window of 24 hours. The producer job expiration window determines how long the producer job will continue to run without a heartbeat from the consumer job. For more details, refer to the [Technical Overview]({% link {{ page.version.version }}/physical-cluster-replication-technical-overview.md %}).
44
+
<spanclass="version-tag">New in v25.2:</span> `SET REPLICATION SOURCE EXPIRATION WINDOW = duration` | Override the default producer job's expiration window of 24 hours from the primary cluster. The producer job expiration window determines how long the producer job will continue to run without a heartbeat from the consumer job. For more details, refer to the [Technical Overview]({% link {{ page.version.version }}/physical-cluster-replication-technical-overview.md %}).
46
45
`START REPLICATION OF virtual_cluster_spec ON physical_cluster` | Reset a virtual cluster to the time when the virtual cluster on the promoted standby diverged from it. To reuse as much of the existing data on the original primary cluster as possible, you can run this statement as part of the [failback]({% link {{ page.version.version }}/failover-replication.md %}#failback) process. This command fails if the virtual cluster was not originally replicated from the original primary cluster. Refer to [Options](#options) for details on how you can configure a PCR stream initiated as a failback.
47
46
`START SERVICE SHARED` | Start a virtual cluster so it is ready to accept SQL connections after failover.
48
47
`RENAME TO virtual_cluster_spec` | Rename a virtual cluster.
@@ -58,15 +57,15 @@ You can use the following options with `ALTER VIRTUAL CLUSTER {vc} START REPLICA
58
57
59
58
Option | Value | Description
60
59
-------+-------+------------
61
-
`EXPIRATION WINDOW` | Duration | Override the default producer job's expiration window of 24 hours. The producer job expiration window determines how long the producer job will continue to run without a heartbeat from the consumer job. For more details, refer to the [Technical Overview]({% link {{ page.version.version }}/physical-cluster-replication-technical-overview.md %}).
60
+
`EXPIRATION WINDOW` | Duration | Override the default producer job's expiration window of 24 hours from the primary cluster. The producer job expiration window determines how long the producer job will continue to run without a heartbeat from the consumer job. For more details, refer to the [Technical Overview]({% link {{ page.version.version }}/physical-cluster-replication-technical-overview.md %}).
62
61
`READ VIRTUAL CLUSTER` | N/A | ([**Preview**]({% link {{ page.version.version }}/cockroachdb-feature-availability.md %}#features-in-preview)) Configure the PCR stream to allow reads from the standby cluster. <br>**Note:** This only allows for reads on the standby's virtual cluster. You cannot perform writes or schema changes to user tables while connected to the standby virtual cluster. For more details, refer to [Start the failback process](#start-the-failback-process).
63
62
`RETENTION` | Duration | Change the [duration]({% link {{ page.version.version }}/interval.md %}) of the retention window that will control how far in the past you can [fail over]({% link {{ page.version.version }}/failover-replication.md %}) to.<br><br>{% include {{ page.version.version }}/physical-replication/retention.md %}
64
63
65
64
## Examples
66
65
67
66
### Start the failover process
68
67
69
-
To start the [failover]({% link {{ page.version.version }}/failover-replication.md %}#failover) process, use `COMPLETE REPLICATION` and provide the timestamp to restore as of:
68
+
To start the [failover]({% link {{ page.version.version }}/failover-replication.md %}#failover) process from the standby cluster, use `COMPLETE REPLICATION` and provide the timestamp to restore as of:
70
69
71
70
{% include_cached copy-clipboard.html %}
72
71
~~~sql
@@ -112,7 +111,7 @@ ALTER VIRTUAL CLUSTER main SET REPLICATION RETENTION = '24h';
112
111
113
112
### Start a virtual cluster
114
113
115
-
When a virtual cluster is [`ready`]({% link {{ page.version.version }}/show-virtual-cluster.md %}#responses) after initiating the failover process, you must start the service so that the virtual cluster is ready to accept SQL connections:
114
+
When a virtual cluster is [`ready`]({% link {{ page.version.version }}/show-virtual-cluster.md %}#responses) after initiating the failover process, you must start the service so that the virtual cluster is ready to accept SQL connections. On the standby cluster, run:
Copy file name to clipboardExpand all lines: src/current/v25.2/create-virtual-cluster.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -19,12 +19,12 @@ Physical cluster replication is only supported in CockroachDB {{ site.data.produ
19
19
20
20
## Required privileges
21
21
22
-
`CREATE VIRTUAL CLUSTER` requires one of the following privileges:
22
+
{% include_cached new-in.html version="v25.2" %} The following [privileges]({% link {{ page.version.version }}/security-reference/authorization.md %}) are required to start a PCR stream with `CREATE VIRTUAL CLUSTER`:
23
23
24
-
- The `admin` role.
25
-
- The `MANAGEVIRTUALCLUSTER`[system privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#privileges) allows the user to run all the related `VIRTUAL CLUSTER` SQL statements for PCR.
24
+
- The `REPLICATIONDEST` and `MANAGEVIRTUALCLUSTER` system privileges: The user starting the PCR stream from the standby cluster.
25
+
- The `REPLICATIONSOURCE`system privilege: The user specified in the connection string for the primary cluster.
26
26
27
-
Use the [`GRANT SYSTEM`]({% link {{ page.version.version }}/grant.md %}) statement:
27
+
Use the [`GRANT SYSTEM`]({% link {{ page.version.version }}/grant.md %}) statement to grant the necessary privileges to users:
Copy file name to clipboardExpand all lines: src/current/v25.2/drop-virtual-cluster.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ The `DROP VIRTUAL CLUSTER` statement will delete all data related to the specifi
24
24
`DROP VIRTUAL CLUSTER` requires one of the following privileges:
25
25
26
26
- The `admin` role.
27
-
- The `MANAGEVIRTUALCLUSTER`[system privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#privileges) allows the user to run all the related `VIRTUAL CLUSTER` SQL statements for PCR.
27
+
- The `MANAGEVIRTUALCLUSTER`[system privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#privileges).
28
28
29
29
Use the [`GRANT SYSTEM`]({% link {{ page.version.version }}/grant.md %}) statement:
Copy file name to clipboardExpand all lines: src/current/v25.2/set-up-physical-cluster-replication.md
+6-17Lines changed: 6 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -105,7 +105,7 @@ Connect to your primary cluster's system virtual cluster using [`cockroach sql`]
105
105
106
106
### Create a replication user and password
107
107
108
-
The standby cluster connects to the primary cluster's system virtual cluster using an identity with the `REPLICATION` privilege. Connect to the primary cluster's system virtual cluster and create a user with a password:
108
+
The standby cluster connects to the primary cluster's system virtual cluster using an identity with the `REPLICATIONSOURCE` privilege. Connect to the primary cluster's system virtual cluster and create a user with a password:
109
109
110
110
1. From the primary's system virtual cluster SQL shell, create a user and password:
111
111
@@ -114,14 +114,14 @@ The standby cluster connects to the primary cluster's system virtual cluster usi
114
114
CREATE USER {your username} WITH PASSWORD '{your password}';
115
115
~~~
116
116
117
-
1. Grant the [`REPLICATION` system privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#supported-privileges) to your user:
117
+
1. Grant the [`REPLICATIONSOURCE` privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#supported-privileges) to your user:
118
118
119
119
{% include_cached copy-clipboard.html %}
120
120
~~~ sql
121
-
GRANT SYSTEM REPLICATION TO {your username};
121
+
GRANT SYSTEM REPLICATIONSOURCE TO {your username};
122
122
~~~
123
123
124
-
If you need to change the password later, refer to [`ALTER USER`]({% link {{ page.version.version }}/alter-user.md %}).
124
+
If you need to change the password later, refer to [`ALTER USER`]({% link {{ page.version.version }}/alter-user.md %}).
125
125
126
126
### Connect to the primary virtual cluster (optional)
127
127
@@ -200,17 +200,6 @@ Connect to your standby cluster's system virtual cluster using [`cockroach sql`]
200
200
--certs-dir "certs"
201
201
~~~
202
202
203
-
1. Add your cluster organization and [{{ site.data.products.enterprise }} license]({% link {{ page.version.version }}/licensing-faqs.md %}#types-of-licenses) to the cluster:
204
-
205
-
{% include_cached copy-clipboard.html %}
206
-
~~~ sql
207
-
SET CLUSTER SETTING cluster.organization = 'your organization';
208
-
~~~
209
-
{% include_cached copy-clipboard.html %}
210
-
~~~ sql
211
-
SET CLUSTER SETTING enterprise.license = 'your enterprise license';
212
-
~~~
213
-
214
203
1. Set the `kv.rangefeed.enabled` cluster setting to `true`. The replication job connects to a long-lived request, a _rangefeed_, which pushes changes as they happen:
215
204
216
205
{% include_cached copy-clipboard.html %}
@@ -236,7 +225,7 @@ Connect to your standby cluster's system virtual cluster using [`cockroach sql`]
236
225
237
226
### Create a user for the standby cluster
238
227
239
-
If you would like to access the [DB Console]({% link {{ page.version.version }}/ui-overview.md %}) to observe your replication, you will need to create a user:
228
+
Create a use to run the PCR stream and access the [DB Console]({% link {{ page.version.version }}/ui-overview.md %}) to observe the job:
240
229
241
230
1. Create a user:
242
231
@@ -249,7 +238,7 @@ If you would like to access the [DB Console]({% link {{ page.version.version }}/
249
238
250
239
{% include_cached copy-clipboard.html %}
251
240
~~~ sql
252
-
GRANT admin TO {your username};
241
+
GRANT SYSTEM REPLICATIONDEST, MANAGEVIRTUALCLUSTER TO {your username};
253
242
~~~
254
243
255
244
Open the DB Console in your web browser: `https://{node IP or hostname}:8080/`, where you will be prompted for these credentials. Refer to [Physical Cluster Replication Monitoring]({% link {{ page.version.version }}/physical-cluster-replication-monitoring.md %}) for more detail on tracking relevant metrics for your replication stream.
0 commit comments