Database/Cassandra

Cassandra Install

BUST 2018. 7. 28. 16:56

Cassandra Install

Reference




How to install (debian install package)


echo "deb http://www.apache.org/dist/cassandra/debian 36x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list

curl https://www.apache.org/dist/cassandra/KEYS | sudo apt-key add -

sudo apt-get update

sudo apt-get install cassandra


command

sudo service cassandra start

sudo service cassandra stop

nodetool status


config/log

/etc/cassandra

/var/log/cassandra/

/var/lib/cassandra


Sample Data

CREATE  KEYSPACE test;

CREATE TABLE test.test( 
    code text, 
    location text, 
    sequence text, 
    description text, 
    PRIMARY KEY (code, location)
);

INSERT INTO test.test (code, location, sequence, description ) VALUES ('N1', 'Seoul', 'first', 'AA');
INSERT INTO test.test (code, location, sequence, description ) VALUES ('N1', 'Gangnam', 'second', 'BB');
INSERT INTO test.test (code, location, sequence, description ) VALUES ('N2', 'Seongnam', 'third', 'CC');
INSERT INTO test.test (code, location, sequence, description ) VALUES ('N2', 'Pangyo', 'fourth', 'DD');
INSERT INTO test.test (code, location, sequence, description ) VALUES ('N2', 'Jungja', 'fifth', 'EE');

Select * from test_keyspace.test_table_ex1;


'Database > Cassandra' 카테고리의 다른 글

Apache Cassandra  (0) 2018.09.17
Cassandra Model Design Examples  (0) 2018.02.10