欢迎投稿

今日深度:

第 3 章 Cassandra,cassandra

第 3 章 Cassandra,cassandra


目录

3.1. Getting Started
3.1.1. Downloading and Installation
3.1.2. Running Cassandra
3.1.3. cli tool
3.1.4. Testing Cassandra
3.2. Configure Cassandra
3.2.1. Envionment variables
3.2.2. log4j.properties
3.2.3. storage-conf.xml
3.3. Keyspace
3.3.1. Schema
3.3.1.1. Keyspace
3.3.1.2. Column family
3.3.1.2.1. Name
3.3.1.2.2. Column
3.3.1.2.3. Super column
3.3.1.2.4. Sorting
3.3.2. Keyspace example
3.4. Cluster
3.4.1. Running a cluster
3.4.2. Running a single node
3.4.3. nodetool

http://incubator.apache.org/cassandra/

3.1. Getting Started

3.1.1. Downloading and Installation

$ cd /srv/

		
$ cd /usr/local/src/

$ sudo wget -c http://apache.freelamp.com/cassandra/0.5.1/apache-cassandra-0.5.1-bin.tar.gz
$ sudo tar zxvf apache-cassandra-0.5.1-bin.tar.gz
$ cp -r /usr/local/src/apache-cassandra-0.5.1 /srv/
$ cd /srv/
$ sudo ln -s apache-cassandra-0.5.1 apache-cassandra
$ cd apache-cassandra
		
		

3.1.2. Running Cassandra

Running Cassandra

		
$ bin/cassandra
$ Listening for transport dt_socket at address: 8888
INFO - Saved Token not found. Using 70882909557229809272696372631016976044
INFO - Starting up server gossip
		
		

3.1.3. cli tool

cli

$ bin/cassandra-cli
		
neo@db:/srv/apache-cassandra$ bin/cassandra-cli
Welcome to cassandra CLI.

Type 'help' or '?' for help. Type 'quit' or 'exit' to quit.
cassandra>
		
		

		
cassandra> connect localhost/9160
Connected to localhost/9160
		
		

3.1.4. Testing Cassandra

test

		
cassandra> show keyspaces
Keyspace1
system
		
		

insert value

		
cassandra> set Keyspace1.Standard1['member']['name']='neo'
Value inserted.
cassandra> set Keyspace1.Standard1['member']['age']='27'
Value inserted.
cassandra> set Keyspace1.Standard1['member']['email']='openunix@163.com'
Value inserted.
cassandra>
cassandra> get Keyspace1.Standard1['member']
=> (column=name, value=neo, timestamp=1271070497471)
=> (column=email, value=openunix@163.com, timestamp=1271070498334)
=> (column=age, value=27, timestamp=1271070497519)
Returned 3 results.
cassandra>
		
		





原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

www.htsjk.Com true http://www.htsjk.com/cassandra/11231.html NewsArticle 第 3 章 Cassandra,cassandra 目录 3.1. Getting Started 3.1.1. Downloading and Installation 3.1.2. Running Cassandra 3.1.3. cli tool 3.1.4. Testing Cassandra 3.2. Configure Cassandra 3.2.1. Envionment variables 3.2.2. log4j.properties 3...
评论暂时关闭