0
0 Comments

分片集群使用,PSA模式

master     mongos    config    shard1-主节点    shard2-仲 裁    shard3-副节点

slaver1    mongos    config    shard1-副节点    shard2-主节点    shard3-仲 裁

slaver2    mongos    config    shard1-仲 裁    shard2-副节点    shard3-主节点

C#连接驱动,连接字符串写了三个mongos进程的端口,对user和order进入订单插入的事务中

情况一:user和order集合不分片,整个db都集中在shard2,事务操作正常

情况二:user以userid作为片键,order也使用userid作为片键,事务操作异常

报错:Command commitTransaction failed: from shard shard3 :: caused by :: ‘prepareTransaction’ is not supported for replica sets with arbiters.

求支招!!!

Answered question