速度分片问题

Vitess Sharding issue

我是 Vitess 的新手,我们已经使用 Helm Charts 在 Kubernetes 中部署了 Vitess,并通过节点端口公开了 VTGate,并且能够使用公开的 VTGate Ip 地址连接 MYSQL Work bench。 当我们使用 MySql Work Bench 插入记录时,记录不会分散在碎片中。

  * 'Payrolls' is the KeySpace and we created two shards as Payrolls -80,Payrolls 80-.

  * Table Schema as below

     1. TenantList
        (
           TenantID     INT,
           NAme      VARCHAR(200)
        )  


     2.  PayrollMaster
        (
          PayrollID   INT PRIMARY KEY,
          HHAID       INT FOREIGN KEY TO TenantList(TenantID)
        )  

     3. PayrollDetails
       (
         PayrollDetailID    INT PRIMARY KEY,
         PayrollID          INT FOREIGN KEY TO PayrollMaster(PayrollID),
         HHAID              INT FOREIGN KEY TO TenantList(TenantID)
       )

   *   VSchema is as below
      {
       "sharded": true,
       "vindexes": {
        "hash": {
         "type": "hash"
        }
     },
    "tables": {
     "payrollmaster": {
     "column_vindexes": 
      [
       {
         "column": "HHA",
         "name": "hash"
       }
      ],
      "auto_increment": {
       "column": "PayrollInternalID",
       "sequence": "payrollmaster_seq"
      }
    },
    "payrolldetails": {
     "column_vindexes": 
     [
       {
         "column": "HHA",
         "name": "hash"
       }
     ],
     "auto_increment": {
       "column": "PayrollDetailInternalID",
       "sequence": "payrolldetails_seq"
     }
   }
 }
}


    We are inserting the Records like below
      use Payrolls;
      insert into the TenantList,PayrollMaster,PayrollDetails

我们希望记录分散在碎片中,但 table 在碎片中有零行。

我们尝试的方式有什么问题吗?

谢谢

您似乎希望对工资单进行分片。如果是这样,您不应该创建分片“0”。您应该只指定分片“-80”和“80-”