Here I am using Ubuntu Linux machine and also tool called Cassandra Cluster Manager (ccm).
Steps
1. :~/opensource$ mkdir cassandra
2. :~/opensource$ cd cassandra/
3. :~/opensource/cassandra$ git clone https://github.com/riptano/ccm.git
4. :~/opensource/cassandra$ cd ccm/
5. :~/opensource/cassandra/ccm$ ls
ccm ccmlib license.txt MANIFEST.in misc NETWORK_ALIASES.md README.md setup.py ssl tests
6. :~/opensource/cassandra/ccm$ sudo ./setup.py install
7. :~/opensource/cassandra/ccm$ ccm create -v 3.11.2 -n 3 my_cluster --vnodes
10:22:00,960 ccm INFO Downloading http://archive.apache.org/dist/cassandra/3.11.2/apache-cassandra-3.11.2-bin.tar.gz to /tmp/ccm-Wo1DBu.tar.gz (36.656MB)
38436262 [100.00%]10:24:09,353 ccm INFO Extracting /tmp/ccm-Wo1DBu.tar.gz as version 3.11.2 ...
Current cluster is now: my_cluster
cluster name: my_cluster
cassandra version: 3.11.2
number of nodes: 3
8. :~/opensource/cassandra/ccm$ ccm list
*my_cluster
9. :~/opensource/cassandra/ccm$ ccm status
Cluster: 'my_cluster'
---------------------
node1: DOWN (Not initialized)
node3: DOWN (Not initialized)
node2: DOWN (Not initialized)
10. :~/opensource/cassandra/ccm$ ccm start
:~/opensource/cassandra/ccm$ ccm status
Cluster: 'my_cluster'
---------------------
node1: UP
node3: UP
node2: UP
11. :~/opensource/cassandra/ccm$ ccm node1 status
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address Load Tokens Owns (effective) Host ID Rack
UN 127.0.0.1 88.93 KiB 256 64.1% 5e9d0ad1-d7d0-4023-b71c-2f57375c2573 rack1
UN 127.0.0.2 69.9 KiB 256 67.3% e8ea9b63-7846-4494-bd0d-2c8dfcb9274b rack1
UN 127.0.0.3 103.62 KiB 256 68.7% 301887a5-b386-47c6-8a59-3f71ea09b9fc rack1
12. :~/opensource/cassandra/ccm$ ccm node1 ring
Datacenter: datacenter1
==========
Address Rack Status State Load Owns Token
9184122387525172037
127.0.0.3 rack1 Up Normal 103.62 KiB 68.67% -9188398778489235111
127.0.0.2 rack1 Up Normal 69.9 KiB 67.27% -9176942363448371450
127.0.0.3 rack1 Up Normal 103.62 KiB 68.67% -9165278195783829162
127.0.0.3 rack1 Up Normal 103.62 KiB 68.67% -9154226470359649220
127.0.0.3 rack1 Up Normal 103.62 KiB 68.67% -9105345187931701041
127.0.0.1 rack1 Up Normal 88.93 KiB 64.06% -9059861789902146091
127.0.0.1 rack1 Up Normal 88.93 KiB 64.06% -9006955999491952161
127.0.0.1 rack1 Up Normal 88.93 KiB 64.06% -8991976771179386553
127.0.0.1 rack1 Up Normal 88.93 KiB 64.06% -8974379714699893637
127.0.0.1 rack1 Up Normal 88.93 KiB 64.06% -8964003200974837827
127.0.0.2 rack1 Up Normal 69.9 KiB 67.27% -8885086536332616726
127.0.0.3 rack1 Up Normal 103.62 KiB 68.67% -8882333637674950203
127.0.0.2 rack1 Up Normal 69.9 KiB 67.27% -8866726432815074132
13. :~/opensource/cassandra/ccm$ ccm stop
14. :~/opensource/cassandra/ccm$ ccm -h
No comments:
Post a Comment