一、Casscanra介绍
Apache Cassandra 是一套开源分散式 NoSQL 资料库系统。它最初由 Facebook 开发,用于储存收件箱等简单格式数据,集 Google BigTable 的数据模型与 Amazon Dynamo 的完全分散式的架构于一身。 Facebook 于2008将Cassandra开源,此后,由于Cassandra良好的 可扩放性 ,被 Digg 、 Twitter 等知名 Web_2.0 网站所采纳,成为了一种流行的分散式结构化数据存储方案。
Cassandra 突出特点:
一些使Cassandra提高竞争力的其他功能:
二、安装布署
1、准备
下载地址 http://cassandra.apache.org/download/ ,最新版本是0.6.1,直接在官网就能下载。
如果提示:"The JAVA_HOME environment variable must be set to run this program",
则安装Sun Jdk-6,然后添加环境变量即可
JAVA_HOME=D:\Program Files\Java\jdk1.6.0
2、修改配置文件,在conf下找到log4j.properties,把log4j.appender.R.File修改成你存放cassandra的目录,
log4j.appender.R.File=D:\WebServer\cassandra\Log
3、添加环境变量
CASSANDRA_HOME=D:\WebServer\cassandra
4、storage-conf.xml配置文件修改,也在conf文件下,修改下面几个节点到自己的目录:
<CommitLogDirectory>D:/WebServer/cassandra/commitlog</CommitLogDirectory>
<DataFileDirectories>
<DataFileDirectory>D:/WebServer/cassandra/data</DataFileDirectory>
</DataFileDirectories>
5、修改cassandra.bat文件,在bin目录下,在SETLOCAL一行后面增加一行指定本地目录:
Set CD=D:\WebServer\cassandra
运行cassandra.bat启动,如果配置成功则提示如下:
Starting Cassandra Server
Listening for transport dt_socket at address: 8888
INFO 12:54:30,612 Auto DiskAccessMode determined to be standard
INFO 12:54:30,802 Sampling index for D:\WebServer\cassandra\data\system\LocationInfo-1-Data.db
INFO 12:54:30,817 Replaying D:\WebServer\cassandra\commitlog\CommitLog-1275022117089.log
INFO 12:54:30,842 Creating new commitlog segment D:/Software/WebServer/cassandra/commitlog\CommitLog-1275022470842.log
INFO 12:54:30,857 LocationInfo has reached its threshold; switching in a fresh Memtable at CommitLogContext(file='D:/Software/WebServer/cassandra/commitlog\CommitLog-
1275022470842.log', position=121)
INFO 12:54:30,857 Enqueuing flush of Memtable(LocationInfo)@22572221
INFO 12:54:30,857 Writing Memtable(LocationInfo)@22572221
INFO 12:54:30,972 Completed flushing D:\WebServer\cassandra\data\system\LocationInfo-2-Data.db
INFO 12:54:30,982 Log replay complete
INFO 12:54:31,022 Saved Token found: 58905827723352031130434533459013100020
INFO 12:54:31,022 Saved ClusterName found: Test Cluster
INFO 12:54:31,032 Starting up server gossip
INFO 12:54:31,072 Binding thrift service to localhost/127.0.0.1:9160
INFO 12:54:31,082 Cassandra starting up...