部分文章内容为公开资料查询整理,原文出处可能未标注,如有侵权,请联系我,谢谢。邮箱地址:gnivor@163.com ►►►需要气球么?请点击我吧!

Cassandra笔记--2. 安装

1. 从apache官网下载Cassandra,我用的版本是2.1.8。压缩包解压,这里的目录是D:\cassandra\apache-cassandra-2.1.8

2. 配置环境变量 
  添加环境变量CASSANDRA_HOME,值为D:\cassandra\apache-cassandra-2.1.8,环境变量path后面添加%CASSANDRA_HOME%\bin

3. 修改配置文件 conf/cassandra.yaml

data_file_directories: D:\cassandra\data
commitlog_directory: D:\cassandra\commitlog
saved_caches_directory: D:\cassandra\saved_caches

原来的是: 

复制代码
# Directories where Cassandra should store data on disk.  Cassandra
# will spread data evenly across them, subject to the granularity of
# the configured compaction strategy.
# If not set, the default directory is $CASSANDRA_HOME/data/data.
# data_file_directories:
#     - /var/lib/cassandra/data

# commit log.  when running on magnetic HDD, this should be a
# separate spindle than the data directories.
# If not set, the default directory is $CASSANDRA_HOME/data/commitlog.
# commitlog_directory: /var/lib/cassandra/commitlog

# saved caches
# If not set, the default directory is $CASSANDRA_HOME/data/saved_caches.
# saved_caches_directory: /var/lib/cassandra/saved_caches
复制代码
 


4. 修改conf/logback.xml

将${cassandra.logdir} 改为你想要存放的位置,我的是 D:\cassandra\log\system.log


5.修改Cassandra.bat文件

找到下面这部分 

REM -----------------------------------------------------------------------------
REM JVM Opts we'll use in legacy run or installation
set JAVA_OPTS=-ea^
 -javaagent:"%CASSANDRA_HOME%\lib\jamm-0.3.0.jar"^
 -Xms2G^
 -Xmx2G^
 -XX:+HeapDumpOnOutOfMemoryError^
 -XX:+UseParNewGC^
 -XX:+UseConcMarkSweepGC^
 -XX:+CMSParallelRemarkEnabled^
 -XX:SurvivorRatio=8^
 -XX:MaxTenuringThreshold=1^
 -XX:CMSInitiatingOccupancyFraction=75^
 -XX:+UseCMSInitiatingOccupancyOnly^
 -Dlogback.configurationFile=logback.xml^
 -Dcassandra.jmx.local.port=7199

 

修改-Xms2G^和-Xmx2G^为适合你机器的大小,我改为  -Xms512M^和Xmx512M^

如果上面不改,可能会由于内存不足而启动失败: 

Could not reserve enough space for 2097152KB object heap  

 

6. 启动

进入命令行,输入cassandra,看到下图则启动成功

 

参考资料: 

 

NoSql之旅--Cassandra安装篇(一)http://www.cnblogs.com/chyu/p/4600183.html

http://blog.csdn.net/maosijunzi/article/details/42120889

XP系统下安装Cassandra

 

posted @ 2015-08-24 15:12  流了个火  阅读(614)  评论(0编辑  收藏  举报
►►►需要气球么?请点击我吧!►►►
View My Stats