问题
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 ).
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.
回答1:
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.
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:
- storage_port
- native_transport_port
- rpc_port
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.
来源:https://stackoverflow.com/questions/29837605/multiple-cassandra-in-same-node