Cassandra集群配置

需要修改的关键配置:conf/cassandra.yaml

cluster_name: 'My Cassandra Cluster'

#  =======集群模式需要添加的配置
# 注意listen_address不能为0.0.0.0
listen_address: your_host_name  
rpc_address: your_host_name

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: "node1ip,node2ip,node3ip"

启动:bin/cassandra -f(前台模式启动)

以服务启动:bin/cassandra

停止服务:pkill -f CassandraDaemon

默认数据目录:(cassandra dir)/data

任意一台节点查看集群状态:bin/nodetool status,7199是集群各节点通讯的端口。

参考:http://wiki.apache.org/cassandra/GettingStarted