I know there are several threads about the NoHostAvailableException
but they simply don\'t provide a solution to my problem.
I can\'t connect to Cassand
Change public IP to private IP
.
If your cassandra is in EC2, you need to configure private IP in yaml
configurations rpc_address: PRIVATE_IP
.
If your client program (java app used to connect cassandra) is also in EC2 then you should add private IP in your code .addContactPoint("PRIVATE_IP").build();
.
If your cassandra is in EC2 and your client app is in out of EC2 (means client java app in your local network) you need to configure private IP in yaml configurations
and public IP in your java app
Then important point is mentioning native_transport_port: 9042
, allow access for port 9042
and Firewall configurations
. I think these things you did correctly. And also ensure that you have properly configured your endpoint snitch endpoint_snitch: Ec2Snitch
in your yaml file. I Hope it will work if you follow these steps....