Advertisement
Guest User

cassandra.yaml

a guest
Jun 29th, 2012
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 19.07 KB | None | 0 0
  1. # Cassandra storage config YAML
  2.  
  3. # NOTE:
  4. #   See http://wiki.apache.org/cassandra/StorageConfiguration for
  5. #   full explanations of configuration directives
  6. # /NOTE
  7.  
  8. # The name of the cluster. This is mainly used to prevent machines in
  9. # one logical cluster from joining another.
  10. cluster_name: 'Test Cluster'
  11.  
  12. # You should always specify InitialToken when setting up a production
  13. # cluster for the first time, and often when adding capacity later.
  14. # The principle is that each node should be given an equal slice of
  15. # the token ring; see http://wiki.apache.org/cassandra/Operations
  16. # for more details.
  17. #
  18. # If blank, Cassandra will request a token bisecting the range of
  19. # the heaviest-loaded existing node.  If there is no load information
  20. # available, such as is the case with a new cluster, it will pick
  21. # a random token, which will lead to hot spots.
  22. initial_token:
  23. auto_bootstrap: false
  24.  
  25. # See http://wiki.apache.org/cassandra/HintedHandoff
  26. hinted_handoff_enabled: true
  27. # this defines the maximum amount of time a dead host will have hints
  28. # generated.  After it has been dead this long, hints will be dropped.
  29. max_hint_window_in_ms: 3600000 # one hour
  30. # Sleep this long after delivering each row or row fragment
  31. hinted_handoff_throttle_delay_in_ms: 50
  32.  
  33. # authentication backend, implementing IAuthenticator; used to identify users
  34. # to use Kerberos Protocol V5 set this property to com.datastax.bdp.cassandra.auth.KerberosAuthenticator
  35. authenticator: org.apache.cassandra.auth.AllowAllAuthenticator
  36.  
  37. # authorization backend, implementing IAuthority; used to limit access/provide permissions
  38. authority: org.apache.cassandra.auth.AllowAllAuthority
  39.  
  40. # The partitioner is responsible for distributing rows (by key) across
  41. # nodes in the cluster.  Any IPartitioner may be used, including your
  42. # own as long as it is on the classpath.  Out of the box, Cassandra
  43. # provides org.apache.cassandra.dht.RandomPartitioner
  44. # org.apache.cassandra.dht.ByteOrderedPartitioner,
  45. # org.apache.cassandra.dht.OrderPreservingPartitioner (deprecated),
  46. # and org.apache.cassandra.dht.CollatingOrderPreservingPartitioner
  47. # (deprecated).
  48. #
  49. # - RandomPartitioner distributes rows across the cluster evenly by md5.
  50. #   When in doubt, this is the best option.
  51. # - ByteOrderedPartitioner orders rows lexically by key bytes.  BOP allows
  52. #   scanning rows in key order, but the ordering can generate hot spots
  53. #   for sequential insertion workloads.
  54. # - OrderPreservingPartitioner is an obsolete form of BOP, that stores
  55. # - keys in a less-efficient format and only works with keys that are
  56. #   UTF8-encoded Strings.
  57. # - CollatingOPP colates according to EN,US rules rather than lexical byte
  58. #   ordering.  Use this as an example if you need custom collation.
  59. #
  60. # See http://wiki.apache.org/cassandra/Operations for more on
  61. # partitioners and token selection.
  62. partitioner: org.apache.cassandra.dht.RandomPartitioner
  63.  
  64. # directories where Cassandra should store data on disk.
  65. data_file_directories:
  66.    - /var/lib/cassandra/data
  67.  
  68. # commit log
  69. commitlog_directory: /var/lib/cassandra/commitlog
  70.  
  71. # saved caches
  72. saved_caches_directory: /var/lib/cassandra/saved_caches
  73.  
  74. # commitlog_sync may be either "periodic" or "batch."
  75. # When in batch mode, Cassandra won't ack writes until the commit log
  76. # has been fsynced to disk.  It will wait up to
  77. # commitlog_sync_batch_window_in_ms milliseconds for other writes, before
  78. # performing the sync.
  79. #
  80. # commitlog_sync: batch
  81. # commitlog_sync_batch_window_in_ms: 50
  82. #
  83. # the other option is "periodic" where writes may be acked immediately
  84. # and the CommitLog is simply synced every commitlog_sync_period_in_ms
  85. # milliseconds.
  86. commitlog_sync: periodic
  87. commitlog_sync_period_in_ms: 10000
  88.  
  89. # any class that implements the SeedProvider interface and has a constructor that takes a Map<String, String> of
  90. # parameters will do.
  91. seed_provider:
  92.    # Addresses of hosts that are deemed contact points.
  93.     # Cassandra nodes use this list of hosts to find each other and learn
  94.     # the topology of the ring.  You must change this if you are running
  95.     # multiple nodes!
  96.     - class_name: org.apache.cassandra.locator.SimpleSeedProvider
  97.       parameters:
  98.          # seeds is actually a comma-delimited list of addresses.
  99.           # Ex: "<ip1>,<ip2>,<ip3>"
  100.           - seeds: "127.0.0.1"
  101.  
  102. # emergency pressure valve: each time heap usage after a full (CMS)
  103. # garbage collection is above this fraction of the max, Cassandra will
  104. # flush the largest memtables.  
  105. #
  106. # Set to 1.0 to disable.  Setting this lower than
  107. # CMSInitiatingOccupancyFraction is not likely to be useful.
  108. #
  109. # RELYING ON THIS AS YOUR PRIMARY TUNING MECHANISM WILL WORK POORLY:
  110. # it is most effective under light to moderate load, or read-heavy
  111. # workloads; under truly massive write load, it will often be too
  112. # little, too late.
  113. flush_largest_memtables_at: 0.75
  114.  
  115. # emergency pressure valve #2: the first time heap usage after a full
  116. # (CMS) garbage collection is above this fraction of the max,
  117. # Cassandra will reduce cache maximum _capacity_ to the given fraction
  118. # of the current _size_.  Should usually be set substantially above
  119. # flush_largest_memtables_at, since that will have less long-term
  120. # impact on the system.  
  121. #
  122. # Set to 1.0 to disable.  Setting this lower than
  123. # CMSInitiatingOccupancyFraction is not likely to be useful.
  124. reduce_cache_sizes_at: 0.85
  125. reduce_cache_capacity_to: 0.6
  126.  
  127. # For workloads with more data than can fit in memory, Cassandra's
  128. # bottleneck will be reads that need to fetch data from
  129. # disk. "concurrent_reads" should be set to (16 * number_of_drives) in
  130. # order to allow the operations to enqueue low enough in the stack
  131. # that the OS and drives can reorder them.
  132. #
  133. # On the other hand, since writes are almost never IO bound, the ideal
  134. # number of "concurrent_writes" is dependent on the number of cores in
  135. # your system; (8 * number_of_cores) is a good rule of thumb.
  136. concurrent_reads: 32
  137. concurrent_writes: 32
  138.  
  139. # Total memory to use for memtables.  Cassandra will flush the largest
  140. # memtable when this much memory is used.  Prefer using this to
  141. # the older, per-ColumnFamily memtable flush thresholds.
  142. # If omitted, Cassandra will set it to 1/3 of the heap.
  143. # If set to 0, only the old flush thresholds are used.
  144. # memtable_total_space_in_mb: 2048
  145.  
  146. # Total space to use for commitlogs.
  147. # If space gets above this value (it will round up to the next nearest
  148. # segment multiple), Cassandra will flush every dirty CF in the oldest
  149. # segment and remove it.
  150. # commitlog_total_space_in_mb: 4096
  151.  
  152. # This sets the amount of memtable flush writer threads.  These will
  153. # be blocked by disk io, and each one will hold a memtable in memory
  154. # while blocked. If you have a large heap and many data directories,
  155. # you can increase this value for better flush performance.
  156. # By default this will be set to the amount of data directories defined.
  157. #memtable_flush_writers: 1
  158.  
  159. # the number of full memtables to allow pending flush, that is,
  160. # waiting for a writer thread.  At a minimum, this should be set to
  161. # the maximum number of secondary indexes created on a single CF.
  162. memtable_flush_queue_size: 4
  163.  
  164. # Buffer size to use when performing contiguous column slices.
  165. # Increase this to the size of the column slices you typically perform
  166. sliced_buffer_size_in_kb: 64
  167.  
  168. # TCP port, for commands and data
  169. storage_port: 7000
  170.  
  171. # SSL port, for encrypted communication.  Unused unless enabled in
  172. # encryption_options
  173. ssl_storage_port: 7001
  174.  
  175. # Address to bind to and tell other Cassandra nodes to connect to. You
  176. # _must_ change this if you want multiple nodes to be able to
  177. # communicate!
  178. #
  179. # Leaving it blank leaves it up to InetAddress.getLocalHost(). This
  180. # will always do the Right Thing *if* the node is properly configured
  181. # (hostname, name resolution, etc), and the Right Thing is to use the
  182. # address associated with the hostname (it might not be).
  183. #
  184. # Setting this to 0.0.0.0 is always wrong.
  185. listen_address:
  186.  
  187. # Address to broadcast to other Cassandra nodes
  188. # Leaving this blank will set it to the same value as listen_address
  189. # broadcast_address: 1.2.3.4
  190.  
  191. # The address to bind the Thrift RPC service to -- clients connect
  192. # here. Unlike ListenAddress above, you *can* specify 0.0.0.0 here if
  193. # you want Thrift to listen on all interfaces.
  194. #
  195. # Leaving this blank has the same effect it does for ListenAddress,
  196. # (i.e. it will be based on the configured hostname of the node).
  197. rpc_address: 0.0.0.0
  198. # port for Thrift to listen for clients on
  199. rpc_port: 9160
  200.  
  201. # enable or disable keepalive on rpc connections
  202. rpc_keepalive: true
  203.  
  204. # Cassandra provides you with a variety of options for RPC Server
  205. # sync  -> Creates one thread per connection but with a configurable number of
  206. #           threads.  This can be expensive in memory used for thread stack for
  207. #           a large enough number of clients.  (Hence, connection pooling is
  208. #           very, very strongly recommended.)
  209. #
  210. # async -> Nonblocking server implementation with one thread to serve
  211. #           rpc connections.  This is not recommended for high throughput use
  212. #           cases.
  213. #
  214. # hsha  -> half sync and half async implementation with configurable number
  215. #           of worker threads (For managing connections).  IO Management is
  216. #           done by a set of threads currently equal to the number of
  217. #           processors in the system. The number of threads in the threadpool
  218. #           is configured via rpc_min_threads and rpc_max_threads.  (Connection
  219. #           pooling is strongly recommended in this case too.)
  220.  
  221. rpc_server_type: sync
  222.  
  223. # Uncomment rpc_min|max|thread to set request pool size.
  224. # You would primarily set max for the sync server to safeguard against
  225. # misbehaved clients; if you do hit the max, Cassandra will block until one
  226. # disconnects before accepting more.  The defaults are min of 16 and max
  227. # unlimited.
  228. #
  229. # For the Hsha server, you would set the max so that a fair amount of resources
  230. # are provided to the other working threads on the server.
  231. #
  232. # This configuration is not used for the async server.
  233. #
  234. # rpc_min_threads: 16
  235. # rpc_max_threads: 2048
  236.  
  237. # uncomment to set socket buffer sizes on rpc connections
  238. # rpc_send_buff_size_in_bytes:
  239. # rpc_recv_buff_size_in_bytes:
  240.  
  241. # Frame size for thrift (maximum field length).
  242. # 0 disables TFramedTransport in favor of TSocket. This option
  243. # is deprecated; we strongly recommend using Framed mode.
  244. thrift_framed_transport_size_in_mb: 15
  245.  
  246. # The max length of a thrift message, including all fields and
  247. # internal thrift overhead.
  248. thrift_max_message_length_in_mb: 16
  249.  
  250. # Set to true to have Cassandra create a hard link to each sstable
  251. # flushed or streamed locally in a backups/ subdirectory of the
  252. # Keyspace data.  Removing these links is the operator's
  253. # responsibility.
  254. incremental_backups: false
  255.  
  256. # Whether or not to take a snapshot before each compaction.  Be
  257. # careful using this option, since Cassandra won't clean up the
  258. # snapshots for you.  Mostly useful if you're paranoid when there
  259. # is a data format change.
  260. snapshot_before_compaction: false
  261.  
  262. # Add column indexes to a row after its contents reach this size.
  263. # Increase if your column values are large, or if you have a very large
  264. # number of columns.  The competing causes are, Cassandra has to
  265. # deserialize this much of the row to read a single column, so you want
  266. # it to be small - at least if you do many partial-row reads - but all
  267. # the index data is read for each access, so you don't want to generate
  268. # that wastefully either.
  269. column_index_size_in_kb: 64
  270.  
  271. # Size limit for rows being compacted in memory.  Larger rows will spill
  272. # over to disk and use a slower two-pass compaction process.  A message
  273. # will be logged specifying the row key.
  274. in_memory_compaction_limit_in_mb: 64
  275.  
  276. # Number of simultaneous compactions to allow, NOT including
  277. # validation "compactions" for anti-entropy repair. This defaults to
  278. # the number of cores. This can help preserve read performance in a
  279. # mixed read/write workload, by mitigating the tendency of small
  280. # sstables to accumulate during a single long running compactions. The
  281. # default is usually fine and if you experience problems with
  282. # compaction running too slowly or too fast, you should look at
  283. # compaction_throughput_mb_per_sec first.
  284. #
  285. # Uncomment to make compaction mono-threaded.
  286. #concurrent_compactors: 1
  287.  
  288. # Multi-threaded compaction. When enabled, each compaction will use
  289. # up to one thread per core, plus one thread per sstable being merged.
  290. # This is usually only useful for SSD-based hardware: otherwise,
  291. # your concern is usually to get compaction to do LESS i/o (see:
  292. # compaction_throughput_mb_per_sec), not more.
  293. multithreaded_compaction: false
  294.  
  295. # Throttles compaction to the given total throughput across the entire
  296. # system. The faster you insert data, the faster you need to compact in
  297. # order to keep the sstable count down, but in general, setting this to
  298. # 16 to 32 times the rate you are inserting data is more than sufficient.
  299. # Setting this to 0 disables throttling. Note that this account for all types
  300. # of compaction, including validation compaction.
  301. compaction_throughput_mb_per_sec: 16
  302.  
  303. # Track cached row keys during compaction, and re-cache their new
  304. # positions in the compacted sstable.  Disable if you use really large
  305. # key caches.
  306. compaction_preheat_key_cache: true
  307.  
  308. # Throttles all outbound streaming file transfers on this node to the
  309. # given total throughput in Mbps. This is necessary because Cassandra does
  310. # mostly sequential IO when streaming data during bootstrap or repair, which
  311. # can lead to saturating the network connection and degrading rpc performance.
  312. # When unset, the default is 400 Mbps or 50 MB/s.
  313. # stream_throughput_outbound_megabits_per_sec: 400
  314.  
  315. # Time to wait for a reply from other nodes before failing the command
  316. rpc_timeout_in_ms: 10000
  317.  
  318. # phi value that must be reached for a host to be marked down.
  319. # most users should never need to adjust this.
  320. # phi_convict_threshold: 8
  321.  
  322. # endpoint_snitch -- Set this to a class that implements
  323. # IEndpointSnitch, which will let Cassandra know enough
  324. # about your network topology to route requests efficiently.
  325. # Out of the box, Cassandra provides
  326. #  - org.apache.cassandra.locator.SimpleSnitch:
  327. #    Treats Strategy order as proximity. This improves cache locality
  328. #    when disabling read repair, which can further improve throughput.
  329. #  - org.apache.cassandra.locator.RackInferringSnitch:
  330. #    Proximity is determined by rack and data center, which are
  331. #    assumed to correspond to the 3rd and 2nd octet of each node's
  332. #    IP address, respectively
  333. # org.apache.cassandra.locator.PropertyFileSnitch:
  334. #  - Proximity is determined by rack and data center, which are
  335. #    explicitly configured in cassandra-topology.properties.
  336. endpoint_snitch: com.datastax.bdp.snitch.DseDelegateSnitch
  337.  
  338. # controls how often to perform the more expensive part of host score
  339. # calculation
  340. dynamic_snitch_update_interval_in_ms: 100
  341. # controls how often to reset all host scores, allowing a bad host to
  342. # possibly recover
  343. dynamic_snitch_reset_interval_in_ms: 600000
  344. # if set greater than zero and read_repair_chance is < 1.0, this will allow
  345. # 'pinning' of replicas to hosts in order to increase cache capacity.
  346. # The badness threshold will control how much worse the pinned host has to be
  347. # before the dynamic snitch will prefer other replicas over it.  This is
  348. # expressed as a double which represents a percentage.  Thus, a value of
  349. # 0.2 means Cassandra would continue to prefer the static snitch values
  350. # until the pinned host was 20% worse than the fastest.
  351. dynamic_snitch_badness_threshold: 0.1
  352.  
  353. # request_scheduler -- Set this to a class that implements
  354. # RequestScheduler, which will schedule incoming client requests
  355. # according to the specific policy. This is useful for multi-tenancy
  356. # with a single Cassandra cluster.
  357. # NOTE: This is specifically for requests from the client and does
  358. # not affect inter node communication.
  359. # org.apache.cassandra.scheduler.NoScheduler - No scheduling takes place
  360. # org.apache.cassandra.scheduler.RoundRobinScheduler - Round robin of
  361. # client requests to a node with a separate queue for each
  362. # request_scheduler_id. The scheduler is further customized by
  363. # request_scheduler_options as described below.
  364. request_scheduler: org.apache.cassandra.scheduler.NoScheduler
  365.  
  366. # Scheduler Options vary based on the type of scheduler
  367. # NoScheduler - Has no options
  368. # RoundRobin
  369. #  - throttle_limit -- The throttle_limit is the number of in-flight
  370. #                      requests per client.  Requests beyond
  371. #                      that limit are queued up until
  372. #                      running requests can complete.
  373. #                      The value of 80 here is twice the number of
  374. #                      concurrent_reads + concurrent_writes.
  375. #  - default_weight -- default_weight is optional and allows for
  376. #                      overriding the default which is 1.
  377. #  - weights -- Weights are optional and will default to 1 or the
  378. #               overridden default_weight. The weight translates into how
  379. #               many requests are handled during each turn of the
  380. #               RoundRobin, based on the scheduler id.
  381. #
  382. # request_scheduler_options:
  383. #    throttle_limit: 80
  384. #    default_weight: 5
  385. #    weights:
  386. #      Keyspace1: 1
  387. #      Keyspace2: 5
  388.  
  389. # request_scheduler_id -- An identifer based on which to perform
  390. # the request scheduling. Currently the only valid option is keyspace.
  391. # request_scheduler_id: keyspace
  392.  
  393. # index_interval controls the sampling of entries from the primrary
  394. # row index in terms of space versus time.  The larger the interval,
  395. # the smaller and less effective the sampling will be.  In technicial
  396. # terms, the interval coresponds to the number of index entries that
  397. # are skipped between taking each sample.  All the sampled entries
  398. # must fit in memory.  Generally, a value between 128 and 512 here
  399. # coupled with a large key cache size on CFs results in the best trade
  400. # offs.  This value is not often changed, however if you have many
  401. # very small rows (many to an OS page), then increasing this will
  402. # often lower memory usage without a impact on performance.
  403. index_interval: 128
  404.  
  405. # Enable or disable inter-node encryption
  406. # Default settings are TLS v1, RSA 1024-bit keys (it is imperative that
  407. # users generate their own keys) TLS_RSA_WITH_AES_128_CBC_SHA as the cipher
  408. # suite for authentication, key exchange and encryption of the actual data transfers.
  409. # NOTE: No custom encryption options are enabled at the moment
  410. # The available internode options are : all, none, dc, rack
  411. #
  412. # If set to dc cassandra will encrypt the traffic between the DCs
  413. # If set to rack cassandra will encrypt the traffic between the racks
  414. #
  415. # The passwords used in these options must match the passwords used when generating
  416. # the keystore and truststore.  For instructions on generating these files, see:
  417. # http://download.oracle.com/javase/6/docs/technotes/guides/security/jsse/JSSERefGuide.html#CreateKeystore
  418. encryption_options:
  419.     internode_encryption: none
  420.     keystore: conf/.keystore
  421.     keystore_password: cassandra
  422.     truststore: conf/.truststore
  423.     truststore_password: cassandra
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement