这篇博客,对Cassandra配置-cassandra.yaml的配置项进行重点解释。
Option | Default Value |
authenticator | org.apache.cassandra.auth.AllowAllAuthenticator |
authority | org.apache.cassandra.auth.AllowAllAuthority |
broadcast_address | same as listen_address |
cluster_name | Test Cluster(这个名字修改了,cassandra-cli连接的时候,需要指定,默认就是连的这个。) |
column_index_size_in_kb | 64 |
commitlog_directory | /var/lib/cassandra/commitlog |
commitlog_sync | periodic |
commitlog_sync_period_in_ms | 10000 (ten seconds) |
commitlog_total_space_in_mb | 4096 |
compaction_preheat_key_cache | TRUE |
compaction_throughput_mb_per_sec | 16(默认16M,推荐是写入速度的16-32倍,考虑Compaction的速度,这个需要根据实际情况设定) |
concurrent_compactors | One per CPU core |
concurrent_reads | 32 |
concurrent_writes | 32 |
data_file_directories | /var/lib/cassandra/data(可以指定多个目录,会提高性能,但是会出现数据分步不均匀的情况) |
dynamic_snitch | TRUE |
dynamic_snitch_badness_threshold | 0 |
dynamic_snitch_reset_interval_in_ms | 600000 |
dynamic_snitch_update_interval_in_ms | 100 |
endpoint_snitch | org.apache.cassandra.locator.SimpleSnitch |
flush_largest_memtables_at | 0.75 |
hinted_handoff_enabled | TRUE |
hinted_handoff_throttle_delay_in_ms | 50 |
in_memory_compaction_limit_in_mb | 64 |
incremental_backups | FALSE |
index_interval | 128(官方推荐128是最小的,可以更大。但实际中,如果内存比较大,可以适当减小,根据自己的需要设定,间隔小,就会快。) |
initial_token | n/a |
internode_encryption | none |
keystore | conf/.keystore |
keystore_password | cassandra |
listen_address | localhost |
max_hint_window_in_ms | 3600000 (one hour) |
memtable_flush_queue_size | 4 |
memtable_flush_writers | One per data directory |
memtable_total_space_in_mb | 1/3 of the heap |
multithreaded_compaction | FALSE |
partitioner | org.apache.cassandra.dht.RandomPartitioner |
phi_convict_threshold | 8 |
reduce_cache_capacity_to | 0.6 |
reduce_cache_sizes_at | 0.85 |
request_scheduler | org.apache.cassandra.scheduler.NoScheduler |
request_scheduler_id | keyspace |
rpc_address | localhost |
rpc_keepalive | TRUE |
rpc_max_threads | Unlimited |
rpc_min_threads | 16 |
rpc_port | 9160 |
rpc_recv_buff_size_in_bytes | n/a |
rpc_send_buff_size_in_bytes | n/a |
rpc_server_type | sync |
rpc_timeout_in_ms | 10000 |
saved_caches_directory | /var/lib/cassandra/saved_caches |
seeds | 127.0.0.1 |
seed_provider | org.apache.cassandra.locator.SimpleSeedProvider |
sliced_buffer_size_in_kb | 64 |
snapshot_before_compaction | FALSE |
storage_port | 700 |
stream_throughput _outbound_megabits_per_sec | 400 |
thrift_framed_transport_size_in_mb | 15 |
thrift_max_message_length_in_mb | 16 |
truststore | conf/.truststore |
truststore_password | cassandra |
上表中的配置项有一些,比较需要注意的,我就加了注释。后面会逐渐补充。