Datastax-agent Cannot connect Error

cassandraopscenter

Seeing an issue with the Opscenter Agents. Opscenter reports the agents are not connected and in the agent.log on each node, they all report the following:

com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /127.0.0.1:9042 (com.datastax.driver.core. TransportException: [/127.0.0.1:9042] Cannot connect))

I'm not sure when this started, but it's recent and it was working fine previously.

We are running datastax-agent version 5.1.0 and Cassandra version: 2.1.3.

Any tips on where to look would be appreciated.

Best Answer

EDIT: I am leaving the original answer blockquoted below, but please do not try to follow it. The solution provided here is official and tested working!

As mentioned in the documentation:

Note: As of version 5.1 of OpsCenter, the hosts option in address.yaml now determines which nodes the agent connects to. For further information on configuration changes and migration paths, see the Upgrade Guide.

So, just change your address.yaml to reflect those changes and restart the agent. As an example, in our case we performed the following change from this:

stomp_interface: 10.0.10.10
local_interface: 10.0.10.20

to this:

stomp_interface: 10.0.10.10
hosts: ["10.0.10.20"]

The new hosts property is an array of strings, so you can tailor it down to your needs if you need more than one interfaces. But the above should be enough for a standard setup.

The original answer is lying below, please ignore it.

We have the same problem since we upgraded to Opscenter 5.1.0. The only workaround we found so far is to change the rpc setting in cassandra.yaml:

rpc_address: 0.0.0.0

I know this is NOT a politically correct way, but it does the job without breaking everything and you get your OpsCenter to work until a more official way comes.

PS: I really can't see why anyone would downvote this question, it is a serious problem and it breaks production systems.

Related Topic