Can't connect to cassandra - NoHostAvailableException

后端 未结 5 1013
时光取名叫无心
时光取名叫无心 2020-12-01 20:48

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

5条回答
  •  遥遥无期
    2020-12-01 21:50

    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....

提交回复
热议问题