1
votes

I'm trying to run a demo of Spark Cassandra Kafka integration on an Azure VMs. I did run the demo locally and i got result . When i try to connect to Cassandra VM i got the following error:

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

I have 3 (connected) VMs running on CentOs 7, they can ping each other. I have disabled their firewall. I also added inbound ports in the security group.

This may help: when I use nmap to check some specific ports such as 9042 on each machine it shows that it is open locally but when I check other addresses ports it shows that they are closed.

Versions INFO: spark-version : 2.3.1 Scala-version : 2.11.7 java-version : 1.8.0_181 cqlsh: 5.0.1 | cassandra 3.9.0 | CQL spec 3.4.2

1
The following problem is probably due Cassandra version. You can use bitnami cassandra to solve as @charles mentioned below. - Cherif Rzouga

1 Answers

1
votes

First of all, Azure VMs in the same Vnet can access each other. And you have checked that with ping each other.

You can check follow the steps:

  1. Check the Security rules if allow the traffic to the port 9042 for all VMs.
  2. Check if the service listens to the port 9042 and can access locally.
  3. Check if the firewall allows the traffic from port 9042.

If you don't mind, you can dissociate the NSG from the network interface of VMs when testing the connection and only remain the NSG associated with the Subnet.