Use the LinuxCassandra configuration and management platform. After the jdk1.6 or later environment is configured, check the java version. It must be javaversionquot; 1.6.0 _ 24 quot;
Use the Linux Cassandra configuration and management platform. After the jdk1.6 or later environment is configured, check the java version. It must be java version quot; 1.6.0 _ 24 quot;
Paste a configuration example using cassandra
1. Configure the jdk1.6 and later environments.
Check the java version after installation. It must be java version "1.6.0 _ 24" or later. Otherwise, an error similar to out of memory will be reported during startup.
2. Create a log directory and decompress it.
Mkdir-p/var/log/cassandra
Mkdir-p/var/lib/cassandra
Tar zxvf apache-cassandra-0.8.6-bin.tar.gz
3. Start
Cd bin
Nohup./cassandra-f &
Check whether 127.0.0.1: 9106 is started
4. Connection
./Cassandra-cli
Connect localhost/9160 --- connect to other hosts
5. View information
Show cluster name;
6. Create a keyspace
Create keyspace demo
With placement_strategy = 'org. apache. cassandra. locator. simplestrategy'
And strategy_options = [{replication_factor: 1}];
Use demo
7. Create a column family
Create column family users with comparator = UTF8Type AND key_validation_class = UTF8Type AND column_metadata = [{column_name: full_name, validation_class: UTF8Type} {column_name: email, validation_class: UTF8Type}]
View column and Family Information
Describe keyspace demo;
8. Read and Write Data
Write Data
SET users ['bobbyjo '] ['full _ name'] = 'Robert Jones ';
SET users ['bobbyjo '] ['email'] = 'bobjones @ gmail.com ';
Set Manager ['pig'] ['Big '] = '000000 ';
Confirm write
Count users ['bobbyjo '];
2 columns
Read data
Get users ['bobbyjo '];
=> (Column = email, value = bobjones@gmail.com, timestamp = 1318176737871000)
=> (Column = full_name, value = Robert Jones, timestamp = 1318176726678000)
Returned 2 results.
Delete data-the email column of the bobbyjo row key value
Del users ['bobbyjo '] [email];
Column removed.
Del users ['bobbyjo '] -- deletes a row. The column name is not specified.
Manage machine software:
Cassandra-Cluster-Admin: Manages databases through web. Easy to deploy and use.