如何将 cassandra 与 zookeeper 集成以支持事务 [英] how to integrate cassandra with zookeeper to support transactions

查看:26
本文介绍了如何将 cassandra 与 zookeeper 集成以支持事务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了 Cassandra 集群和 Zookeeper 服务器.现在我想使用zookeeper支持cassandra中的事务.我怎么做.

I have a Cassandra cluster and Zookeeper server installed. Now I want to support transactions in cassandra using zookeeper. How do i do that.

Zookeeper 创建 znode 来执行读写操作,数据在 Zookeeper 中来回通过 znode.我想知道如何使用 Zookeeper 在 cassandra 中支持回滚和提交功能.有什么办法可以在zookeeper中指定cassandra配置,或者在cassandra中指定zookeeper配置.

Zookeeper creates znodes to perform read and write operations and data to and fro goes through znodes in Zookeeper. I want to know that how to support rollback and commit feature in cassandra using Zookeeper. Is there any way by which we can specify cassandra configurations in zookeeper or zookeeper configurations in cassandra.

我分别了解 cassandra 和 zookeeper 如何读取和写入数据,但我不知道如何使用 Java 集成它们.

I know cassandra and zookeeper individually how data is read and written but I dont know how to integrate both of them using Java.

我们如何使用 Zookeeper 在 Cassandra 中进行交易.

how can we do transactions in Cassandra using Zookeeper.

谢谢.

推荐答案

我安装了 Cassandra 集群和 Zookeeper 服务器.现在我想使用zookeeper支持cassandra中的事务.我该怎么做.

I have a Cassandra cluster and Zookeeper server installed. Now I want to support transactions in cassandra using zookeeper. How do i do that.

困难重重.Cassandra 作为一个事务系统不能很好地工作.多行写入不是原子性的,有些写入失败无法回滚写入,也无法保证读者读取时读取到一致的视图.

With great difficulty. Cassandra does not work well as a transactional system. Writes to multiple rows are not atomic, there is no way to rollback writes if some writes fail, and there is no way to ensure readers read a consistent view when reading.

我想知道如何使用 Zookeeper 在 cassandra 中支持回滚和提交功能.

I want to know that how to support rollback and commit feature in cassandra using Zookeeper.

Zookeeper 不会帮你解决这个问题,尤其是提交功能.您可能可以向zookeeper写入足够的信息以在失败时回滚,但如果您这样做,您不妨将回滚信息存储在cassandra中.

Zookeeper won't help you with this, especially the commit feature. You may be able to write enough information to zookeeper to roll back in case of failure, but if you are doing that, you might as well store the rollback info in cassandra.

当您将 Zookeeper 用作锁定服务时,Zookeeper 和 Cassandra 可以很好地协同工作.查看 Cages 库.使用 zookeeper 协调对 cassandra 的读/写.

Zookeeper and Cassandra work well together when you use Zookeeper as a locking service. Look at the Cages library. Use zookeeper to co-ordinate read/writes to cassandra.

尝试将 cassandra 用作事务系统,对多行进行原子提交和回滚将非常令人沮丧.

Trying to use cassandra as a transactional system with atomic commits to multiple rows and rollbacks is going to be very frustrating.

这篇关于如何将 cassandra 与 zookeeper 集成以支持事务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆