Apache Cassandra Learning Step by Step (1): Setup to play
来源:互联网 发布:crontab java 编辑:程序博客网 时间:2024/06/08 18:12
By Bright Zheng (IT进行时, MSN: zhengxianquan AT hotmail)
1. About Apache Cassandra
Apache Cassandra is one of the powerful NoSQL platforms.
Link: http://cassandra.apache.org/
Following are some useful comparisons on some classic NoSQL platforms which we need to make a decision if we want to get involved in such a domain.
1. Cassandra vs MongoDB vs CouchDB vs Redis vs Riak vs HBase vs Membase vs Neo4j comparison: http://kkovacs.eu/cassandra-vs-mongodb-vs-couchdb-vs-redis
2. HBase vs Cassandra: http://blog.adku.com/2011/02/hbase-vs-cassandra.html
2. Development environment Setup
2.1. Software required
SN
Name
Description
1
Apache Cansandra
Mandatory. Current stable version is 1.0.7
@http://cassandra.apache.org/download/
2
Cassandra Tutorial
Mandatory. Source code for following writeups.
@http://github.com/zznate/cassandra-tutorial.git
3
GIT
Optional. Tools for latest source code download & sync
4
Maven
Optional. I’m using 3.x, or 3.0.3 exactly.
5
Hactor
Optional. Recommended Java client implementation for deeper learning experience since it encapsulates all Cassandra’s Concepts/APIs as a higer layer Concepts/APIs.
2.2. Software install & configuration
2.2.1. Apache Cassandra (as single node first)
Download & unzip, that’s almost done.
Better to configure two files for some runtime info (data/log/etc.).
1. $APACHE_CASSANDRA$/conf/cassandra.yaml
cluster_name: 'Test Cluster'
# directories where Cassandra should store data on disk.
data_file_directories:
- ../runtime/data
# commit log
commitlog_directory: ../runtime/commitlog
# saved caches
saved_caches_directory: ../runtime/saved_caches
2. $APACHE_CASSANDRA$/conf/log4j-server.properties
log4j.appender.R.File=../runtime/system.log
Double click $APACHE_CASSANDRA$/bin/cassandra.bat to start Cassandra.
If you want to enable JMX for runtime monitoring, please download MX4J from here and extract mx4j.jar and mx4j-tools.jar to $APACHE_CASSANDRA$/lib and then restart Cassandra.
One more thing you should understand is that the JMX port will be defaulted to 8081 (Ref to the source code here). If you got port conflict issue, you have two ways to change the port.
1. Add a parameter to the start up bat (or $APACHE_CASSANDRA$/bin/cassandra.bat) as -Dmx4jport=8082, or
2. Change the bat directly at following lines:
@REM original
@REM "%JAVA_HOME%\bin\java" %JAVA_OPTS% %CASSANDRA_PARAMS% -cp %CASSANDRA_CLASSPATH% "%CASSANDRA_MAIN%"
@REM change to follwing
set mx4jport=7599
"%JAVA_HOME%\bin\java" %JAVA_OPTS% %CASSANDRA_PARAMS% -Dmx4jport=%mx4jport% -cp %CASSANDRA_CLASSPATH% "%CASSANDRA_MAIN%"
2.2.2. Git & Maven
Omitted…
2.2.3. Cassandra Tutorial
1. Open Git Bash:
By double clicking the Git Bash under Git install folder.
2. Download the source:
git clone http://github.com/zznate/cassandra-tutorial.git
Note:
If your network is via proxy, run follwing command first:
export http_proxy={YOUR PROXY HOST/IP}:{PORT}
3. Import to Eclipse:
This is a maven project so we can import it to Eclipse as existing Maven project.
2.2.4. Hactor
1. Open Git Bash:
By double clicking the Git Bash under Git install folder.
2. Download the source:
git clone http://github.com/rantav/hector.git
3. Import to Eclipse:
Hactor is a mavan project(s). So we can import it to Eclipse as existing maven project.
It has 3 sub projects: core, orm & test.
Take note that the orm sub project is lack of javax.persistence dependency.
I added it as org.hibernate.javax.persistence: hibernate-jpa-2.0-api.jar
- Apache Cassandra Learning Step by Step (1): Setup to play
- Apache Cassandra Learning Step by Step (2): Core Concepts
- Apache Cassandra Learning Step by Step (3): Samples ABC
- Apache Cassandra Learning Step by Step (4): Data Modeling
- Apache Cassandra Learning Step by Step (5): 实战性的JTwissandra项目
- Step By Step Learning
- Informix Setup Step by Step
- Step by step tutorial to setup a JBoss Seam application
- Learning URDF Step by Step
- Learning URDF Step by Step
- <Deep Learning>Step by Step
- Securing Apache: Step-by-Step
- Android Beginners: NDK Setup Step by Step
- Android Beginners: NDK Setup Step by Step
- Step-by-step learning C + +(chapter fivesummary____Expressions)
- Learning MVC 3.0 Step by Step
- Learning Python Step by Step Using Example
- 用Apache AXIS 开发 Web Services Step By Step(1)
- Saving HDU
- java web项目加密 方法一
- 背包优化
- sprintf 用法(sprintf_s)
- 交行新一代托管平台项目的总结
- Apache Cassandra Learning Step by Step (1): Setup to play
- EXCEL排序
- 源代码阅读
- 基于XMPP搭建手机聊天应用
- 01、J2SE基础-继承、抽象类、接口
- ArrayList、Vector、LinkedList的区别及其优缺点?
- C语言中数组的数组
- SSIS Additional Components Projects
- Hashtable和HashMap有什么区别