I'm fairly new to Cassandra, and have recently implemented a 2-node cluster on Amazon EC2. I have the 2 data nodes, and 1 application server (running .NET 4.0, connecting to the data nodes through the Cassandra driver), all in the same Amazon availability zone.

After a whole lot of tweaking of the security group, I was finally able to get the connection to work by creating an inbound rule on each of the data nodes to allow ALL TCP traffic from the application server. I don't think this is particularly ideal security-wise, even though I don't see it as a huge risk especially since I'm using private IPs.

My question is this, what port is used for the connection between a .NET Cassandra driver, and the cluster? Based on the documentation, I thought that's what the 9160 RPC port was all about, but when I created a rule for that it didn't seem to do anything. I also tried 7199 and 9042 (just based on little tid bits I've found scattered on the internet).

Thanks, Todd

有帮助吗?

解决方案

It should be whatever is configured on your cassandra-env.sh file. As per the docs:

http://wiki.apache.org/cassandra/FAQ#ports

Having said if you look at the .NET driver for Cassandra (C#) in the file Cassandra/Cluster.cs it mentions that default from the driver is 9042. You can see the file here: https://github.com/datastax/csharp-driver/blob/1.0/Cassandra/Cluster.cs . Also, this is the excerpt that shows the default port:

/// <summary>
///  The port to use to connect to the Cassandra host. If not set through this
///  method, the default port (9042) will be used instead.
/// </summary>
/// <param name="port"> the port to set. </param>
///
/// <returns>this Builder</returns>
public Builder WithPort(int port)
{
    this._port = port;
    return this;
}

Hope it helps.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top