|
Size: 1547
Comment:
|
Size: 1584
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 35: | Line 35: |
| describe keyspaces; | |
| Line 40: | Line 41: |
| describe tables; |
Cassandra
The Apache Cassandra Project develops a highly scalable second-generation distributed database, bringing together Dynamo's fully distributed design and Bigtable's ColumnFamily-based data model.
Slackbuild
- cd /tmp
wget http://slackbuilds.org/slackbuilds/14.1/system/apache-cassandra.tar.gz
- tar xvzf apache-cassandra.tar.gz
wget http://archive.apache.org/dist/cassandra/2.0.7/apache-cassandra-2.0.7-bin.tar.gz
./apache-cassandra.SlackBuild
- installpkg /tmp/apache-cassandra-2.0.7-noarch-1_SBo.tgz
Node up
- useradd cassandra
- mkdir /home/cassandra
- cd /home/cassandra
- chown cassandra . -R
- mkdir /var/lib/cassandra
- cd /var/lib/cassandra
- chown cassandra . -R
- mkdir /var/log/cassandra
- cd /var/log/cassandra
- chown cassandra . -R
- JAVA_HOME=/opt/java /opt/apache-cassandra/bin/cassandra -f
cqlsh
http://wiki.apache.org/cassandra/GettingStarted
- bin/cqlsh
CREATE KEYSPACE mykeyspace WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };
describe keyspaces;
USE mykeyspace;
CREATE TABLE users ( user_id int PRIMARY KEY, fname text, lname text );
INSERT INTO users (user_id, fname, lname) VALUES (1745, 'john', 'smith');
INSERT INTO users (user_id, fname, lname) VALUES (1744, 'john', 'doe');
INSERT INTO users (user_id, fname, lname) VALUES (1746, 'john', 'smith');
describe tables;
SELECT * FROM users;
desc table users;
CREATE INDEX ON users (lname);
desc table users;
SELECT * FROM users WHERE lname = 'smith';