Use of LinuxCassandra configuration and management platform

Source: Internet
Author: User
Tags cassandra
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.