Skip to content

2.25.1.0-b134

@Deepti-yb Deepti-yb tagged this 06 Jan 18:05
Summary:
XCluster commands:
```
yba xcluster
Manage YugabyteDB Anywhere xClusters (Asynchronous Replication)

Usage:
  yba xcluster [flags]
  yba xcluster [command]

Aliases:
  xcluster, async-replication

Available Commands:
  delete      Delete a YugabyteDB Anywhere xCluster
  describe    Describe a YugabyteDB Anywhere xcluster between two universes
  list        List a YugabyteDB Anywhere xcluster between two universes
  pause       Pause a YugabyteDB Anywhere xCluster
  restart     Restart replication for databases in the YugabyteDB Anywhere sxCluster configuration
  resume      Resume a YugabyteDB Anywhere xCluster
  sync        Reconcile a YugabyteDB Anywhere xcluster configuration with database

Flags:
  -h, --help   help for xcluster

Global Flags:
  -a, --apiToken string    YugabyteDB Anywhere api token.
      --config string      Config file, defaults to $HOME/.yba-cli.yaml
      --debug              Use debug mode, same as --logLevel debug.
      --disable-color      Disable colors in output. (default false)
  -H, --host string        YugabyteDB Anywhere Host (default "http://localhost:9000")
  -l, --logLevel string    Select the desired log level format. Allowed values: debug, info, warn, error, fatal. (default "info")
  -o, --output string      Select the desired output format. Allowed values: table, json, pretty. (default "table")
      --timeout duration   Wait command timeout, example: 5m, 1h. (default 168h0m0s)
      --wait               Wait until the task is completed, otherwise it will exit immediately. (default true)
```

List:
```
yba xcluster list -h
List a xcluster in YugabyteDB Anywhere

Usage:
  yba xcluster list [flags]

Aliases:
  list, ls

Examples:
yba xcluster list --source-universe-name <source-universe-name> \
          --target-universe-name <target-universe-name>

Flags:
      --source-universe-name string   [Required] The name of the source universe for the xcluster.
      --target-universe-name string   [Required] The name of the target universe for the xcluster.
  -h, --help                          help for list

Global Flags:
  -a, --apiToken string    YugabyteDB Anywhere api token.
      --config string      Config file, defaults to $HOME/.yba-cli.yaml
      --debug              Use debug mode, same as --logLevel debug.
      --disable-color      Disable colors in output. (default false)
  -H, --host string        YugabyteDB Anywhere Host (default "http://localhost:9000")
  -l, --logLevel string    Select the desired log level format. Allowed values: debug, info, warn, error, fatal. (default "info")
  -o, --output string      Select the desired output format. Allowed values: table, json, pretty. (default "table")
      --timeout duration   Wait command timeout, example: 5m, 1h. (default 168h0m0s)
      --wait               Wait until the task is completed, otherwise it will exit immediately. (default true)
```

Describe
```
yba xcluster describe
Describe a xcluster in YugabyteDB Anywhere between two universes

Usage:
  yba xcluster describe [flags]

Aliases:
  describe, get

Examples:
yba xcluster describe --uuid <xcluster-uuid>

Flags:
  -u, --uuid string   [Required] The uuid of the xcluster to get details.
  -h, --help          help for describe

Global Flags:
  -a, --apiToken string    YugabyteDB Anywhere api token.
      --config string      Config file, defaults to $HOME/.yba-cli.yaml
      --debug              Use debug mode, same as --logLevel debug.
      --disable-color      Disable colors in output. (default false)
  -H, --host string        YugabyteDB Anywhere Host (default "http://localhost:9000")
  -l, --logLevel string    Select the desired log level format. Allowed values: debug, info, warn, error, fatal. (default "info")
  -o, --output string      Select the desired output format. Allowed values: table, json, pretty. (default "table")
      --timeout duration   Wait command timeout, example: 5m, 1h. (default 168h0m0s)
      --wait               Wait until the task is completed, otherwise it will exit immediately. (default true)
```

Delete:
```
yba xcluster delete -h
Delete a xCluster in YugabyteDB Anywhere between two universes

Usage:
  yba xcluster delete [flags]

Aliases:
  delete, remove, rm

Examples:
yba xcluster delete --uuid <uuid>

Flags:
  -u, --uuid string   [Required] The uuid of the xcluster to be deleted.
  -f, --force         [Optional] Bypass the prompt for non-interactive usage.
  -h, --help          help for delete

Global Flags:
  -a, --apiToken string    YugabyteDB Anywhere api token.
      --config string      Config file, defaults to $HOME/.yba-cli.yaml
      --debug              Use debug mode, same as --logLevel debug.
      --disable-color      Disable colors in output. (default false)
  -H, --host string        YugabyteDB Anywhere Host (default "http://localhost:9000")
  -l, --logLevel string    Select the desired log level format. Allowed values: debug, info, warn, error, fatal. (default "info")
  -o, --output string      Select the desired output format. Allowed values: table, json, pretty. (default "table")
      --timeout duration   Wait command timeout, example: 5m, 1h. (default 168h0m0s)
      --wait               Wait until the task is completed, otherwise it will exit immediately. (default true)
```

Sync:
```
yba xcluster sync -h
If changes have been made to your xCluster configuration outside of YugabyteDB Anywhere (for example, using yb-admin), reconciling the xCluster configuration with the database updates the configuration in YugabyteDB Anywhere to match the changes.

Usage:
  yba xcluster sync [flags]

Examples:
yba xcluster sync --uuid <xcluster-uuid>

Flags:
  -u, --uuid string   [Required] The uuid of the xcluster to sync.
  -h, --help          help for sync

Global Flags:
  -a, --apiToken string    YugabyteDB Anywhere api token.
      --config string      Config file, defaults to $HOME/.yba-cli.yaml
      --debug              Use debug mode, same as --logLevel debug.
      --disable-color      Disable colors in output. (default false)
  -H, --host string        YugabyteDB Anywhere Host (default "http://localhost:9000")
  -l, --logLevel string    Select the desired log level format. Allowed values: debug, info, warn, error, fatal. (default "info")
  -o, --output string      Select the desired output format. Allowed values: table, json, pretty. (default "table")
      --timeout duration   Wait command timeout, example: 5m, 1h. (default 168h0m0s)
      --wait               Wait until the task is completed, otherwise it will exit immediately. (default true)
```

Restart:
```
yba xcluster restart -h
Restart replication for databases in the YugabyteDB Anywhere xCluster configuration

Usage:
  yba xcluster restart [flags]

Examples:
yba xcluster restart --uuid <xcluster-uuid> --storage-config-name <storage-config-name>

Flags:
  -u, --uuid string                  [Required] The uuid of the xcluster to restart.
      --storage-config-name string   [Required] Storage config to be used for taking the backup for replication.
      --dry-run                      [Optional] Run the pre-checks without actually running the subtasks. (default false)
      --table-uuid string            [Optional] Comma separated list of source universe table uuids to restart. If not specified, all tables will be restarted.
      --parallelism int              [Optional] Number of concurrent commands to run on nodes over SSH via "yb_backup" script. (default 8)
      --force-delete                 [Optional] Force restart the universe xcluster despite errors. (default false)
  -f, --force                        [Optional] Bypass the prompt for non-interactive usage.
  -h, --help                         help for restart

Global Flags:
  -a, --apiToken string    YugabyteDB Anywhere api token.
      --config string      Config file, defaults to $HOME/.yba-cli.yaml
      --debug              Use debug mode, same as --logLevel debug.
      --disable-color      Disable colors in output. (default false)
  -H, --host string        YugabyteDB Anywhere Host (default "http://localhost:9000")
  -l, --logLevel string    Select the desired log level format. Allowed values: debug, info, warn, error, fatal. (default "info")
  -o, --output string      Select the desired output format. Allowed values: table, json, pretty. (default "table")
      --timeout duration   Wait command timeout, example: 5m, 1h. (default 168h0m0s)
      --wait               Wait until the task is completed, otherwise it will exit immediately. (default true)
```

Pause/Resume:
```
Pause/Resume a xCluster in YugabyteDB Anywhere between two universes

Usage:
  yba xcluster pause/resume [flags]

Examples:
yba xcluster pause/resume --uuid <xcluster-uuid>

Flags:
  -u, --uuid string   [Required] The uuid of the xcluster to pause/resume.
  -h, --help          help for pause/resume

Global Flags:
  -a, --apiToken string    YugabyteDB Anywhere api token.
      --config string      Config file, defaults to $HOME/.yba-cli.yaml
      --debug              Use debug mode, same as --logLevel debug.
      --disable-color      Disable colors in output. (default false)
  -H, --host string        YugabyteDB Anywhere Host (default "http://localhost:9000")
  -l, --logLevel string    Select the desired log level format. Allowed values: debug, info, warn, error, fatal. (default "info")
  -o, --output string      Select the desired output format. Allowed values: table, json, pretty. (default "table")
      --timeout duration   Wait command timeout, example: 5m, 1h. (default 168h0m0s)
      --wait               Wait until the task is completed, otherwise it will exit immediately. (default true)
```

Test Plan:
`yba xcluster list --source-universe-name dkumar-cli --target-universe-name dkumar-cli-1`
```
Name      UUID                                   Source Universe                                    Target Universe                                      Status
test      b452d195-20fe-464e-bcde-fbd5810011a7   dkumar-cli(6afeccc8-e34c-43b7-a7fe-0ab81984e21b)   dkumar-cli-1(37acf516-c35e-4418-943b-43f928890504)   Running
```

`yba xcluster describe  --uuid  b452d195-20fe-464e-bcde-fbd5810011a7`
```
General
Name      UUID                                   Source Universe                                    Target Universe                                      Status
test      b452d195-20fe-464e-bcde-fbd5810011a7   dkumar-cli(6afeccc8-e34c-43b7-a7fe-0ab81984e21b)   dkumar-cli-1(37acf516-c35e-4418-943b-43f928890504)   Running

XCluster Details
Source Active   Source State          Target Active   Target State          Used For Disaster Recovery
true            Unconfigured for DR   true            Unconfigured for DR   false

Type      Table Type   Replication Group Name                      Create Time                       Modify Time
Txn       YSQL         6afeccc8-e34c-43b7-a7fe-0ab81984e21b_test   Mon, 30 Dec 2024 17:42:49 +0000   Mon, 30 Dec 2024 17:44:00 +0000

Tables
000034cb000030008000000000004001

Databases
-

Lag Metric Data
{
  "tserver_async_replication_lag_micros": {
    "data": [
      {
        "instanceName": "yb-15-dkumar-cli-n3",
        "metricName": "",
        "name": "Sent Lag",
        "type": "scatter",
        "x": [
          1735902150000
        ],
        "y": [
          "0"
        ]
      },
      {
        "instanceName": "yb-15-dkumar-cli-n3",
        "metricName": "",
        "name": "Committed Lag",
        "type": "scatter",
        "x": [
          1735902150000
        ],
        "y": [
          "0"
        ]
      }
    ],
    "directURLs": [
      "https://10.9.3.89:9090/graph?g0.expr=avg%28max+by+%28exported_instance%2C+saved_name%29%28%7Bnode_prefix%3D%22yb-15-dkumar-cli%22%2C+saved_name%3D%7E%22async_replication_sent_lag_micros%7Casync_replication_committed_lag_micros%22%2C+stream_id%3D%22d700b0408c34ceb6ca433a05c3467977%22%7D%29%29+by+%28exported_instance%2C+saved_name%29+%2F+1000\u0026g0.tab=0\u0026g0.range_input=3600s\u0026g0.end_input="
    ],
    "layout": {
      "title": "Async Replication Lag",
      "xaxis": {
        "alias": {},
        "type": "date"
      },
      "yaxis": {
        "alias": {
          "async_replication_committed_lag_micros": "Committed Lag",
          "async_replication_sent_lag_micros": "Sent Lag"
        },
        "ticksuffix": "\u0026nbsp;ms"
      }
    },
    "metricsLinkUseBrowserFqdn": true,
    "queryKey": "tserver_async_replication_lag_micros"
  }
}

PITR Configurations
PITR Configuration 1: Details

Name      UUID                                   DB Name    Schedule Interval (In milliseconds)   State     Table Type
          bfe11218-aafa-40e3-b10c-4830f033a1a5   yugabyte   21600                                           PGSQL_TABLE_TYPE

PITR Details
Retention Period (In seconds)   Maximum Recover Time (In milliseconds)   Minimum Recover Time (In milliseconds)
86400                           0                                        0

Create Time            Update Time
2024-12-30T17:43:48Z   2024-12-30T17:43:48Z

Created For DR   Used For XCluster
true             true

PITR Configuration 2: Details

Name      UUID                                   DB Name    Schedule Interval (In milliseconds)   State     Table Type
          dce26335-f81c-4914-9aab-4b237e3fb29d   yugabyte   21600                                           PGSQL_TABLE_TYPE

PITR Details
Retention Period (In seconds)   Maximum Recover Time (In milliseconds)   Minimum Recover Time (In milliseconds)
86400                           0                                        0

Create Time            Update Time
2024-12-30T17:43:52Z   2024-12-30T17:43:52Z

Created For DR   Used For XCluster
true             true

```

`yba xcluster delete -u b452d195-20fe-464e-bcde-fbd5810011a7 `
```
? Are you sure you want to delete xcluster: b452d195-20fe-464e-bcde-fbd5810011a7 Yes
Waiting for xcluster b452d195-20fe-464e-bcde-fbd5810011a7 to be deleted
The xcluster b452d195-20fe-464e-bcde-fbd5810011a7 has been deleted
```

Reviewers: hzare

Reviewed By: hzare

Subscribers: yugaware

Differential Revision: https://phorge.dev.yugabyte.com/D40772
Assets 2
Loading