Skip to content

Commit

Permalink
add a rollback step (#8467) (#8506)
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored May 9, 2022
1 parent fc74c89 commit 38c9129
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion two-data-centers-in-one-city-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,38 @@ cat rule.json
]
```

To use the configurations in `rule.json`, override the existing configurations by running the following command:
To use the configurations in `rule.json`, run the following command to back up the existing configuration to the `default.json` file and overwrite the existing configuration with `rule.json`:

{{< copyable "shell-regular" >}}

```bash
pd-ctl config placement-rules rule-bundle load --out="default.json"
pd-ctl config placement-rules rule-bundle save --in="rule.json"
```

If you need to roll back to the previous configuration, you can restore the backup file `default.json` or write the following JSON file manually and overwrite the current configuration with this JSON file:

```
cat default.json
[
{
"group_id": "pd",
"group_index": 0,
"group_override": false,
"rules": [
{
"group_id": "pd",
"id": "default",
"start_key": "",
"end_key": "",
"role": "voter",
"count": 3
}
]
}
]
```

### Enable the DR Auto-Sync mode

The replication mode is controlled by PD. You can configure the replication mode in the PD configuration file using one of the following methods:
Expand Down

0 comments on commit 38c9129

Please sign in to comment.