`
zhaoshijie
  • 浏览: 2242151 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

cassandra-0.6.1安装配置(与集群)

 
阅读更多
关键字:cassandra-0.6.1安装配置(与集群)
相关博客:http://www.ibm.com/developerworks/cn/opensource/os-cn-cassandraxu1/index.html

1 下载Cassandra
http://cassandra.apache.org/下载版本0.5.1。

2 安装Cassandra
安装目录D:\apache-cassandra-0.5.1。在此需要修改两个配置文件

1 修改conf目录下的log4j.properties文件:
log4j.appender.R.File=D:\apache-cassandra-0.5.1\logs

2 修改conf目录下的storage-conf.xml文件:
<CommitLogDirectory>D:\apache-cassandra-0.5.1\commitlog</CommitLogDirectory>
<DataFileDirectories>            
    <DataFileDirectory>D:\apache-cassandra-0.5.1\data</DataFileDirectory>
</DataFileDirectories>           
<CalloutLocation>D:\apache-cassandra-0.5.1\callouts</CalloutLocation>
<StagingFileDirectory>D:\apache-cassandra-0.5.1\staging</StagingFileDirectory>

3 修改系统的环境变量:
CASSANDRA_HOME=D:\apache-cassandra-0.5.1

3 启动Cassandra
运行bin目录下的cassandra.bat。看到:INFO - Starting up server gossip,那么恭喜你,Cassandra已经在你的本机启动起来了。







集群配置:

其实,你单台服务器已经会部署呢,那多台集群是非常简单的一个操作。

主要就是修改配置文件(storage-conf.xml)的一些属性,

当增加一个节点时,我们修改配置文件的一下几个选项

1、

<Seeds>
    <Seed>127.0.0.1</Seed>
</Seeds>

修改为

<Seeds>
    <Seed>192.168.1.3</Seed>
    <Seed>192.168.1.8</Seed>
</Seeds>

其中seed列表中包括其他的节点IP

2、

<ListenAddress>localhost</ListenAddress>

修改为

<ListenAddress>192.168.1.3</ListenAddress>

listenaddress中填的是自己本机的IP

3、

<ThriftAddress>localhost</ThriftAddress>

修改为:

<ThriftAddress>0.0.0.0</ThriftAddress>

0.0.0.0表示侦听所有接口

到这里,一个cassandra集群就已经配置好了。

下面我们就可以测试了

登陆本机添加数据,在登陆另一台机器看刚才在本机添加的数据是否已经同步。

如果已经同步了,那就说明已经添加好了。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics