1. 三个结点的集群. my version: apache-cassandra-3.9-bin.tar
三台机器: 172.20.5.2,172.20.5.3,172.20.5.4(cpu八核),在conf/cassandra.yaml修改了如下的参数:
seeds list: 172.20.5.2,172.20.5.3cluster_name: 'WeidaiCassandraCluster'
num_tokens: 256
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: "172.20.5.2,172.20.5.3"
listen_address: 172.20.5.2
rpc_address: 172.20.5.2
data_file_directories:
- /hdd2/cassandra/data
- /hdd3/cassandra/data
commitlog_directory: /hdd1/cassandra/commitlog
memtable_heap_space_in_mb: 8192
memtable_offheap_space_in_mb: 8192
memtable_flush_writers: 4
saved_caches_directory: /hdd1/cassandra/saved_caches
auto_snapshot: false
concurrent_reads: 64
concurrent_writes: 64
concurrent_counter_writes: 64
2. remember that: starting the seed nodes one at a time, and then starting the rest of the nodes.
bin/cassandra -R(这里我使用root用户启动,实际是不建议root启动, 非root用户不用加上-R)
3. errors:
error1:
ERROR 11:52:30 Fatal configuration error
org.apache.cassandra.exceptions.ConfigurationException: /172.20.5.2:7000 is in use by another process. Change listen_address:
storage_port in cassandra.yaml to values that do not conflict with other services
change: storage_port: 7000 -> storage_port: 7010
error2: ./bin/cqlsh db1
No appropriate python interpreter found.
solution: in linux, upgrade python from 2.6 to 2.7.
4. next ,
how to monitor cassandra ?