admin管理员组文章数量:1336100
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
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/<unresolved>:9042, hostId=ccb86d7f-7f2d-4c63-9f07-c45c7849db91, hashCode=36891956)=southcentralus-d. Current DCs in this cluster are: southcentralus-d, westus2-d.
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
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/<unresolved>:9042, hostId=ccb86d7f-7f2d-4c63-9f07-c45c7849db91, hashCode=36891956)=southcentralus-d. Current DCs in this cluster are: southcentralus-d, westus2-d.
Share
edited Jan 16 at 4:53
Erick Ramirez
16.4k2 gold badges21 silver badges31 bronze badges
asked Nov 19, 2024 at 19:31
Deepak KothariDeepak Kothari
1,76327 silver badges41 bronze badges
1
- I also made it work by passing a query string parameter as below but passing it as VM options is neat and readable! jdbc:cassandra://cassandra.prod-az-southcentralus-301.prod.us:9042?localdatacenter=southcentralus-d – Deepak Kothari Commented Nov 20, 2024 at 15:56
2 Answers
Reset to default 7Click "Advanced", at "VM options", put "-Ddatastax-java-driver.basic.load-balancing-policy.local-datacenter=datacenter1"
To add to @Jane He's answer, the default load balancing policy for the driver requires the name of the data centre local to the contact points. The driver only contacts nodes in the local DC unless the default behaviour is overridden by allowing remote nodes (not recommended).
For details, see the Cassandra Java driver Quickstart and Load balancing guides. Cheers!
本文标签:
版权声明:本文标题:cassandra - Connecting from IntelliJ IDE returns "Since you provided explicit contact points, the local DC must be expl 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742403217a2468298.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论