Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我将如何使用 Zookeeper 在客户端和数据库之间强制执行单个客户端写锁?
(即一次只有一个客户端可以写入数据库)
如果你使用 Python,用 Kazoo 做这件事是微不足道的:
从 kazoo.client 导入 KazooClient
k = KazooClient(myhost) k.start()
与 k.Lock(): do_exlusive_write()