Pre-Req
Please follow this to setup a multi-node cluster (You can try this post with single node cluster as well. For that just follow till step 4 of the link).
Instantiating a cluster:
10.10.0.4 and 10.10.0.32 are ip addresses of 2 nodes of our cluster. These are initial contact points.
You don't need to give exhaustive list here. Just few of them or even one of them is sufficient. Once the driver find one of them, he will automatically discover rest.
Connect to cluster:
Instantiating a cluster does not connect driver to the cluster. To connect you should give something like
Set Keyspace:
Executing Queries:
Now we are all set to execute queries. Simplest way is to use execute method
No comments:
Post a Comment