cassandra集群部署

    在国内cassandra感觉用的人不多,资料也比较少,一查全是hbase和mongodb等no sql的资料,比起国外,cassandra确实要活跃的多。说起来,cassandra集群部署非常简单,虽然比起elastic search和redis稍微麻烦一点点,但是比起hbase和mongodb 的集群部署,真是简单多了。

    首先准备机器,我这里准备三台,192.168.1.100/101/102。用100作为seed机器。首先配置100上的cassandra。打开conf/cassandra.yaml。修改3个地方:

    1.listen_address: 192.168.1.100

    2.rpc_address: 192.168.1.100

    3.seed_provider:

    # Addresses of hosts that are deemed contact points. 

    # Cassandra nodes use this list of hosts to find each other and learn

    # the topology of the ring.  You must change this if you are running

    # multiple nodes!

    - class_name: org.apache.cassandra.locator.SimpleSeedProvider

      parameters:

          # seeds is actually a comma-delimited list of addresses.

          # Ex: "<ip1>,<ip2>,<ip3>"

          - seeds: "192.168.1.100"

    然后把配置好的cassandra目录拷贝到101和102,

    $> scp -r apache-cassandra-x.y.z 192.168.1.101

    $> scp -r apache-cassandra-x.y.z 192.168.1.102

    修改101和102上的部分配置,只需要修改1和2两个地方,也就是:listen_address和rpc_address修改为自己的ip,第3个地方,seed_provider不需要修改。然后启动100/101/102。启动成功以后,使用nodetool查看集群状态。

 $> bin/nodetool status

 #########################################################################################

 里面就一个seed配置需要注意,seed意思是种子,在这里意思就相当于种子节点,用来发现节点的,然后把他们加入集群。实际上就是每台机器cassandra启动以后,会和自己配置的seed机器通信,seed节点就把它加入集群配置中去。

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值