同一节点中有多个Cassandra [英] Multiple Cassandra in same node

查看:67
本文介绍了同一节点中有多个Cassandra的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有3个节点.我想提出一个3节点的cassandra(1个节点中的1个Cassandra)和3个单节点的cassandra(每个节点中的1个).

I have 3 nodes. I would like to bring up a 3node cassandra ( 1 Cassandra in 1 node ) and 3 single node cassandra (1 in each node ).

因此,在1个节点中,有一个3节点cassandra和单节点cassandra的实例.

So in 1 node, there is an instance of a 3 node cassandra and single node cassandra.

我可以通过更改正在使用的端口号来进行部署吗?

Can I deploy like this by changing the port number is in use?

我可以在单节点部署中使用相同的端口号吗?

Can I use same port number across single node deployments.

推荐答案

除非您为每个cassandra节点提供自己的数据并提交日志卷,否则我不建议这样做.Cassandra已针对其数据(SSTables)的顺序读写访问进行了优化,如果您有多个Cassandra实例竞争I/O,则性能将不会很好.

I would not recommend this unless you give each cassandra node its own data and commit log volume(s). Cassandra is optimized for sequential read and write access of its data (SSTables) and if you have multiple Cassandra instances competing for I/O your performance is going to not be very good.

要回答您的问题,您可以执行此操作,cassandra.yaml中需要更改许多配置文件.假设您正在使用cassandra 2.0及以上版本,则为:

To answer your question, you can do this, there are a number of configuration files in cassandra.yaml you need to change. Assuming you are using cassandra 2.0 and up these are:

  • 存储端口
  • native_transport_port
  • rpc_port

无论使用什么客户端与cassandra交互,这些客户端都需要支持指定备用端口.幸运的是,datastax驱动程序支持此功能.例如,java驱动程序具有

Whatever client(s) you use to interface with cassandra, those need to support specifying alternative ports. Fortunately the datastax drivers support this. For example the java-driver has a addContactPointsWithPorts method for specifying contact points with their respective ports for creating a connection to the cassandra cluster.

同样,在生产环境中,我强烈建议不要这样做.不建议使用多个节点共享同一磁盘,并且同一主机上的多个节点会增加复杂性.

Again, I would strongly discourage this in a production setting. Multiple nodes sharing the same disk is discouraged, and mulitple nodes on the same host adds complexity.

这篇关于同一节点中有多个Cassandra的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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