1

I installed Cassandra DB on my Ubuntu VM1 and also installed on other VM Ubuntu VM2. MY question is:

How to initialize multi node cluster (single data-center) on my VM's?

I also changed my Cassandra.yaml like below:

  1. IP default to IP system seed , listen_address.
  2. cluster_name: 'MyDigitalOceanCluster'
  3. initial_token: 0
  4. seed_provider:
  5. seeds: "198.211.50.0"
  6. listen_address: 198.211.50.0
  7. rpc_address: 0.0.0.0
  8. endpoint_snitch: RackInferringSnitch

After the changes I received this message:

Connection error: ('Unable to connect to any servers', {'127.0.0.1': 
error(111, "Tried connecting to [('127.0.0.1', 9042)]. Last error: 
Connection refused")})
2
  • How are you seeing that error? From cqlsh? Commented Jan 19, 2021 at 13:41
  • Just wondering, because an IP address should really be specified with cqlsh. Also, the seeds: parameter should have both IP addresses (in a 2 node cluster, I'd make them both seed nodes). Commented Jan 19, 2021 at 18:52

1 Answer 1

2

Aaron has pretty much given you the answers but for what it's worth set the following in cassandra.yaml:

  • num_tokens: 16 or if you prefer to specify tokens, make sure you pick tokens which are balanced
  • listen_address: private_ip
  • rpc_address: public_ip (or same IP if your VM only has 1 NIC)
  • set seeds to the IP of both nodes (1 of the nodes is sufficient but 2 is preferred)
  • endpoint_snitch: GossipingPropertyFileSnitch is recommended and almost always the right choice (see my reasons here https://community.datastax.com/questions/8887/)

When connecting with cqlsh, you need to specify the node's client IP (rpc_address) otherwise it will default to localhost (127.0.0.1). For example:

$ cqlsh 198.211.50.0

Cheers!

Sign up to request clarification or add additional context in comments.

2 Comments

thank you so much, but i dont understand. i mean i changed cassandra yaml like this: 1- listen_address: private_ip 2- seed: other node private_ip 3- rpc_address: private_ip and I'm working on my local VM and i dont have any public address? what do you mean when you are talking about public address because i dont have any public_ip ???? what can i do now?????
As I stated in my answer, you can use the same IP for both listen_address and rpc_address if your VM only has 1 NIC. Cheers!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.