n0derunner

    How to generate a new hostid for a Cassandra node.

    Published: (Updated: ) in Database Performance by .

    If you clone a Cassandra VM with the goal of creating a cassandra cluster – you may find that every Cassandra node has the same hostID.

    Steps to generate a new hostid:

    Example

    $ nodetool status
     Datacenter: datacenter1
     Status=Up/Down
     |/ State=Normal/Leaving/Joining/Moving
     --  Address    Load        Tokens  Owns (effective)  Host ID                               Rack
     UN  127.0.0.1  224.75 KiB  16      100.0%            e83be842-a05e-4acb-9c92-0f18fb3690be  rack1
    
    $ sudo service cassandra stop; sudo rm -rf /var/lib/cassandra/data/system ; sudo  rm -rf /var/lib/cassandra/*; sudo service cassandra start
    
    
    $ nodetool status
     Datacenter: datacenter1
     Status=Up/Down
     |/ State=Normal/Leaving/Joining/Moving
     --  Address    Load        Tokens  Owns (effective)  Host ID                               Rack
     UN  127.0.0.1  164.49 KiB  16      100.0%            b93fd004-0679-46b6-be75-81da2850f07b  rack1

    Comments

    Leave a Comment