Run multiple cassandra nodes (a cluster) from the same machine?

狂风中的少年 提交于 2019-12-03 13:06:13

问题


How can I run 3 cassandra nodes (actually a cluster) from my Ubuntu? I don't want to create 3 instances of VMWare/VirtualBox but instead, configure each cassandra node to listen to a different port. Is that possible with one cassandra installation?

A solution that came to my mind is to have 3 local cassandra installation and configure each cassandra.yaml independently but actually I would prefer to have achieve that by my installed cassandra configuration files.

I need such configuration only for testing purposes, obviously.


回答1:


Check this Cassandra Cluster Manager on github https://github.com/pcmanus/ccm

(link is to script that configures multiple Cassandras to listen on different localhost interfaces 127.0.0.1, 127.0.0.2, 127.0.0.3)




回答2:


I guess it would be possible if you had 3 copy of the program, 3 different configurations where every port is different, and you'd have to exclude those ports from the possible connection sockets.

Edit I don't understand the downvotes. This is actually the simplest way to do it, have one set of binaries and create a set of conf and yaml files for each of your nodes, then use one launch script for each of the local nodes you want.

Example : Machine 1 on 7199, Machine 2 on 7200, Machine 3 on 7201 and so forth. Use aliases for your localhost IP, 127.0.0.2, .3, .4 etc

Nodetool ring will work as intended, and show you a cluster, only all of them will be with the same root IP.




回答3:


I've seem problems with port conflicts on a JMX library ?jamm maybe? before, that doesn't seem configured through the yaml, but maybe the launch .sh script can disable it, that appears to be a JVM option built up in the launch script.

There was also a trick with using a different loopback addresses for the server instances so they could coexist with the same ports, but that ran into the jamm problems. That was from the Packt cassandra high performance cookbook.

But as of 1.2.5 and higher, roughly, I have not been able to do this successfully.



来源:https://stackoverflow.com/questions/14478833/run-multiple-cassandra-nodes-a-cluster-from-the-same-machine

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!