请教 以下问题
1)Placement Rules In SQL 是不是必须再配置tikv 的时候要有一个region 标签的?
2)DR Auto-sync 自适应同步模式 中的placement rule 配置文件可以调整为placement rules in sql 这种方式吗?
3)Placement Rules In SQL 是不是可以替代 Placement Rules 了。使用 Placement Rules 要进行配置文件的配置, Placement Rules In SQL 只要一个SQL就搞了。
例如,要实现3副本,同时把testdb 库的所有表region leader放在labeld为bj的tikv 上。只要这样就可以
1) CREATE PLACEMENT POLICY test_policy PRIMARY_REGION=“bj” REGIONS=“bj,dl,sz” FOLLOWERS=2;
2)create database testdb placement policy=test_policy;
如果要用Placement Rules 配置文件方式
{
“group_id”: “pd”,
“group_index”: 0,
“group_override”: false,
“rules”: [
{
“group_id”: “pd”,
“id”: “az-east”,
“start_key”: “”,
“end_key”: “”,
“role”: “voter”,
“count”: 1,
“label_constraints”: [
{
“key”: “region”,
“op”: “in”,
“values”: [
“bj”
]
}
],
“location_labels”: [
“rack”,
“dc”,
“region”
]
},
{
“group_id”: “pd”,
“id”: “az-west”,
“start_key”: “”,
“end_key”: “”,
“role”: “follower”,
“count”: 1,
“label_constraints”: [
{
“key”: “region”,
“op”: “in”,
“values”: [
“dl”
]
}
],
“location_labels”: [
“rack”,
“dc”,
“regon”
]
},
{
“group_id”: “pd”,
“id”: “az-west”,
“start_key”: “”,
“end_key”: “”,
“role”: “learner”,
“count”: 1,
“label_constraints”: [
{
“key”: “region”,
“op”: “in”,
“values”: [
“sz”
]
}
],
“location_labels”: [
“dc”,
“rack”,
“region”
]
}