NoNodeAvailableException: No node was available to execute the query

Change .withLocalDatacenter("us-east-2") to .withLocalDatacenter("datacenter1") and retry.


You can execute nodetool status in cassandra and you will obtain the name of the Datacenter. That is the value that you must put in withLocalDatacenter method:

/opt/apache-cassandra-3.11.2/bin$ ./nodetool status
Datacenter: **dc1**
===============
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address         Load       Tokens       Owns (effective)  Host ID    Rack