0

I am trying to setup a 3 node Cassandra cluster on single windows machine. This is for testing purpose only.

Step 1 I modified by hosts file as below 127.0.0.1 node1 127.0.0.1 node2 127.0.0.1 node3

Step 2 installed Datastax Cassandra on C:\Cassandra (This is node 1) C:\Cassandra\node2 (node 2) C:\Cassandra\node3 (node 3)

Step 3 Changed Cassandra.yaml file for all 3 nodes cluster_name:DevCluster

Node1: -seed: node1 initial token: 0 listen_address: node1 rpc_address: node1

Node2: -seed: node1 initial token: manually generated number listen_address: node2 rpc_address: node2

Node3: -seed: node1 initial token: manually generated number listen_address: node3 rpc_address: node3

I was able to start Cassandra.bat file to run the service, but the problem is at any point of time I am able to start only one service (any node), the other service shuts down with error message

ERROR [NonPeriodicTasks:1] 2014-04-08 08:59:09,861 StorageService.java (line 364) Stopping gossiper
  WARN [NonPeriodicTasks:1] 2014-04-08 08:59:09,861 StorageService.java (line 278) Stopping gossip by operator request
  INFO [CompactionExecutor:4] 2014-04-08 08:59:09,861 CompactionTask.java (line 275) Compacted 4 sstables to [C:\Cassandra\data\data\system\schema_keyspaces\system-schema_keyspaces-jb-20,].  651 bytes to 260 (~39% of original) in 706ms = 0.000351MB/s.  6 total partitions merged to 3.  Partition merge counts were {1:2, 4:1, }
 ERROR [NonPeriodicTasks:1] 2014-04-08 08:59:09,861 CassandraDaemon.java (line 196) Exception in thread Thread[NonPeriodicTasks:1,5,main]

ERROR [main] 2014-04-08 08:59:10,220 CassandraDaemon.java (line 357) Fatal configuration error
 org.apache.cassandra.exceptions.ConfigurationException: node1/127.0.0.1:7000 is in use by another process.  Change listen_address:storage_port in cassandra.yaml to values that do not conflict with other services
INFO [StorageServiceShutdownHook] 2014-04-08 08:59:10,220 Gossiper.java (line 1251) Announcing shutdown
  INFO [StorageServiceShutdownHook] 2014-04-08 08:59:12,220 MessagingService.java (line 667) Waiting for messaging service to quiesce

IN ADDITION based on the log messages I've changed storage_port, tcp_port and JMX_port to a different number to avoid port conflicts. I am trying to form a cluster... but stuck with this error.

I would really appreciate if some one can guide, what I am messing up. Thanks for your response.

demongolem
  • 9,474
  • 36
  • 90
  • 105

1 Answers1

0

Please see this related question: Run multiple cassandra nodes (a cluster) from the same machine?

It has a link to a solution for Linux that depends on defining multiple localhost IP addresses (i.e. 127.0.0.N where N>1). Something similar may be possible if you can configure multiple IP addresses for your same machine.

In short, Cassandra currently expects homogenous port configurations across the cluster, so assigning unique port numbers isn't going to yield a working cluster. That's also why you can only start one node because your host aliases (node1, node2, etc.) are still mapping to the same IP addresses and therefore the same network interface -- and two processes can't bind to the same TCP port(s) on the same interface at once.

Community
  • 1
  • 1
William Price
  • 4,033
  • 1
  • 35
  • 54