How do i install a cassandra cluster on docker containers?



  • Note: This article assumes you have docker installed.

    This installation installs cassandra on one host system, using two docker containers.

    Install the first docker cassandra container.

    $ docker run --name my_cassandra1 -d cassandra:3.11
    

    Then create another cassandra docker container; connecting to the first container.

    $ docker run --name my_cassandra2 -d --link my_cassandra1:cassandra cassandra:3.11
    

    Connect to the first docker container and check the status.

    $ docker exec -it some-cassandra bash
    

    Check status.

    container> $  nodetool status
    Datacenter: datacenter1
    =======================
    Status=Up/Down
    |/ State=Normal/Leaving/Joining/Moving
    --  Address     Load       Tokens       Owns (effective)  Host ID                               Rack
    UN  172.17.0.3  88.88 KiB  256          100.0%            70161bef-8795-4476-8fdf-2e87a0aa1242  rack1
    UN  172.17.0.2  108.61 KiB  256          100.0%            3583ee8b-15ca-496f-a059-bb1f784ed2ac  rack1
    

Log in to reply
 

© Lightnetics 2024