intellij-ideacassandracassandra-driver

The local DC must be explicitly set error while connecting to cassandra from intellij IDE


I was facing local DC issue connecting to cassandra from intellij IDE. It says that the local DC must be explicitly set. I am providing the below details

hosts : cassandra.prod-az-southcentralus-301.prod.us.net
port : 9042
Authentication : User & Password
User : svcproduser
Password : xxxx
Keyspace : my_cassandra

Using Apache Cassandra driver 1.4 version . I do not see any option to set local DC.Can you help on how you connect to cassandra from Intellij?

Error :

Unexpected error while creating connection. Since you provided explicit contact points, the local DC must be explicitly set (see basic.load-balancing-policy.local-datacenter in the config, or set it programmatically with SessionBuilder.withLocalDatacenter). Current contact points are: Node(endPoint=cassandra.prod-az-southcentralus-301.prod.us.net/<unresolved>:9042, hostId=ccb86d7f-7f2d-4c63-9f07-c45c7849db91, hashCode=36891956)=southcentralus-d. Current DCs in this cluster are: southcentralus-d, westus2-d.

enter image description here


Solution

  • Click "Advanced", at "VM options", put "-Ddatastax-java-driver.basic.load-balancing-policy.local-datacenter=datacenter1"