Cassandra nodetool connection refused on Windows - cassandra

I want to set Cassandra storage for my Titan DB.
For that I have followed instruction from
http://s3.thinkaurelius.com/docs/titan/1.0.0/cassandra.html
I am using Cassandra 3.1.1, For Cassandra 2.2 or higher I need to explicitly enable thrift so that Titan can connect to the cluster.
So I run
/bin/nodetool enablethrift.
It gives me
nodetool: Failed to connect to '127.0.0.1:7199' - ConnectException: 'Connection refused: connect'.
So I done below changes in /conf/cassandra-env.sh
set JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=127.0.0.1/7199
still connection refused issue occurs.

In Cassandra 2.1 and earlier, the compatible version for Titan 1.0, start_rpc: true is the default out of the box.
In Cassandra 2.2 and above, if you want to enable thrift, you either need to update start_rpc: true in the cassandra.yaml before you start Cassandra, or call nodetool enablethrift after Cassandra is started. The connection refused message on port 7199 (JMX port that nodetool communicates with) indicates that Cassandra isn't started.

Related

cqlsh "Unable to connect to any servers" on Windows installation

I installed Cassandra on Windows 10. When i trying to run cqlsh from /bin/,
I get the following error:
Connection error: ('Unable to connect to any servers', {'127.0.0.1': \
error(10061, "Tried connecting to [('127.0.0.1', 9042)].
Last error: No connection could be made because the target machine \
actively refused it")})
I installed Cassandra from apache.org official site . also I get reference from
https://phoenixnap.com/kb/install-cassandra-on-windows - Everything is looks good from the reference.
can anyone help me to solve this ? thanks in Advance.
The error states that cqlsh can't connect to the local Cassandra instance. The default configuration in conf/cassandra.yaml is for Cassandra to listen for CQL clients on localhost (127.0.0.1) and CQL port 9042:
native_transport_port: 9042
rpc_address: localhost
Since you're getting a "connection refused" error, the most likely issue is that Cassandra is not running on your Windows machine. Check the Cassandra logs (usually in logs/system.log) for errors which would provide clues as to why Cassandra couldn't start.
As a side note, there is very limited Windows support in Cassandra 3.x and there are several known issues that will not be fixed due to limitations in the operating system.
Furthermore, Windows support has been completely dropped in Cassandra 4.0 due to lack of maintainers and testing (CASSANDRA-16171).
As a workaround, we recommend the following:
Deploy Cassandra in Docker
Deploy Cassandra in a VM using software like VirtualBox
Deploy K8ssandra.io
If you just want to build apps with Cassandra as a backend, Astra DB has a free tier that lets you launch a Cassandra cluster in a few clicks with no credit card required. Cheers!
Do you keep this terminal open and Cassandra runs when you are trying to connect? Notice you have to launch cqlsh from a different terminal window.
Please check the steps again, mostly probably Cassandra simply doesn't run. Keep attention on the p.4 specially.

Issue: connect rest application with Cassandra

I am using Cassandra 3.11 docker image for my application. But I am getting below. Can someone suggest a fix here
Enable Thrift server of Cassandra
The error means that JanusGraph can't connect to cassandra with thrift, So you have to enable thrift on cassandra.
Use the below command to enable thrift
nodetool enablethrift

OpsCenter unable to connect to existing cassandra cluster

I have a cassandra cluster on two nodes. On a 3rd node, I install OpsCenter and I try to connect to the existing cassandra cluster, the problem is that when I try to connect from OpsCenter it throws the next:
node1: 172.16.8.232
node2: 172.16.8.233
node3(not in the cassandra cluster): 172.16.8.231
Error creating cluster: Unable to connect to cluster. Error is: Unable to connect to any seed nodes, tried [u'172.16.8.232', u'172.16.8.233']
I have try to connect using cqls from the node3 to the cluster:
cqlsh 172.16.8.232 9042
And it works fine, I connect successfully, so I think the problem will be in OpsCenter, maybe is a incompatible versio?
Cassandra version: 3.0.9
OpsCenter 5.2.x only supports up to Cassandra 2.1. OpsCenter 6.0 only supports DataStax Enterprise. So there is no way to use OpsCenter with Apache Cassandra 2.2+. More info in our compatibility table and not on OpsCenter policy changes.

Cassandra Opscenter repair causes Null Pointer Exception

Got a four node apache cassandra cluster (2.1) with DataStax opscenter 5.0.1 running. Everything's running smoothly...I can restart nodes from opscenter. However, if I try to run a repair on a node from the Opscenter UI, I get the following:
"Error during repair on [hostname]: java.lang.NullPointerException:"
I can ssh into the node and run nodetool repair without problems.
Any idea what the problem might be?
Opscenter 5.0 doesn’t support managing Cassandra 2.1 clusters yet, but that’ll change after 5.1 gets released.

Unable to connect Cassandra Test Cluster

I have created 1 node Cassandra cluster (datastax enterprise) on Ubuntu, to which I am able to connect via cqlsh but when i try to connect via OpsCenter or from VS2012 via c# driver I get error like "Unable to connect to cluster" or "All host tried for query are in error", can anyone help me with this error?
EDIT:
I installed the datastax Enterprise following the instructions as given at "datastax.com/documentation/datastax_enterprise/4.0/…; and have all keys with their default value in yaml file except the cluster name. When I run cqlsh it connect with this message:
Connected to fptestcluster at localhost:9160.
[cqlsh 4.1.1 | Cassandra 2.0.6.28 | CQL spec 3.1.1 | Thrift protocol 19.39.0]
But as specified in original question, with OpsCenter and C# driver I am not able to connect.
I found the fix for this, I had to change "listen_address" and "rpc_address" to the IP of machine rather than localhost and then it works, thanks everyone.

Resources