audit_logging
section of cassandra.yaml
nodetool enable/disableauditlog
IAuditLogger
user:cassandra|host:127.0.0.1:7000|source:/127.0.0.1|port:44826|
timestamp:1543713221085|type:LOGIN_SUCCESS|category:AUTH|
operation:LOGIN SUCCESSFUL
user:cassandra|host:127.0.0.1:7000|source:/127.0.0.1|port:44826|
timestamp:1543713221184|type:SELECT|category:QUERY|
ks:simple|scope:tbl|operation:select * from simple.tbl;
user:null|host:127.0.0.1:7000|source:/127.0.0.1|port:44828|
timestamp:1543713227014|type:LOGIN_ERROR|category:AUTH|
operation:LOGIN FAILURE; Provided username baduser and/or
password are incorrect
system_views.settings
cqlsh> select * from system_views.settings;
name | value
---------------------------------------------+--------
start_native_transport | true
storage_port | 7000
stream_entire_sstables | true
stream_throughput_outbound_megabits_per_sec | 200
streaming_connections_per_host | 1
streaming_keep_alive_period_in_secs | 300
tombstone_failure_threshold | 100000
tombstone_warn_threshold | 1000
tracetype_query_ttl | 86400
tracetype_repair_ttl | 604800
system_views.thread_pools
nodetool tpstats
cqlsh> select * from system_views.thread_pools;
name | active_tasks | active_tasks_limit | blocked_tasks | blocked_tasks_all_time | completed_tasks | pending_tasks
------------------------------+--------------+--------------------+---------------+------------------------+-----------------+---------------
AntiEntropyStage | 0 | 1 | 0 | 0 | 0 | 0
CacheCleanupExecutor | 0 | 1 | 0 | 0 | 0 | 0
CompactionExecutor | 1 | 2 | 0 | 0 | 236 | 0
CounterMutationStage | 0 | 32 | 0 | 0 | 0 | 0
GossipStage | 0 | 1 | 0 | 0 | 1655 | 0
HintsDispatcher | 0 | 2 | 0 | 0 | 0 | 0
InternalResponseStage | 0 | 4 | 0 | 0 | 1 | 0
MemtableFlushWriter | 1 | 2 | 0 | 0 | 61 | 0
MemtablePostFlush | 1 | 1 | 0 | 0 | 105 | 0
MemtableReclaimMemory | 0 | 1 | 0 | 0 | 61 | 0
MigrationStage | 0 | 1 | 0 | 0 | 22 | 0
MiscStage | 0 | 1 | 0 | 0 | 0 | 0
MutationStage | 4 | 32 | 0 | 0 | 1674970 | 1
Native-Transport-Requests | 20 | 128 | 0 | 12977 | 2622028 | 0
PendingRangeCalculator | 0 | 1 | 0 | 0 | 3 | 0
PerDiskMemtableFlushWriter_0 | 1 | 2 | 0 | 0 | 61 | 0
ReadRepairStage | 0 | 4 | 0 | 0 | 0 | 0
ReadStage | 1 | 32 | 0 | 0 | 487835 | 1
Repair-Task | 0 | 2147483647 | 0 | 0 | 0 | 0
RequestResponseStage | 0 | 4 | 0 | 0 | 7 | 0
Sampler | 0 | 1 | 0 | 0 | 0 | 0
SecondaryIndexManagement | 0 | 1 | 0 | 0 | 0 | 0
ValidationExecutor | 0 | 2147483647 | 0 | 0 | 0 | 0
ViewBuildExecutor | 0 | 1 | 0 | 0 | 0 | 0
ViewMutationStage | 0 | 32 | 0 | 0 | 0 | 0
system_views.caches
nodetool info
cqlsh> select * from system_views.caches;
name | capacity_bytes | entry_count | hit_count | hit_ratio | recent_hit_rate_per_second | recent_request_rate_per_second | request_count | size_bytes
----------+----------------+-------------+-----------+-----------+----------------------------+--------------------------------+---------------+------------
chunks | 95420416 | 19 | 1021 | 0.965028 | 19 | 22 | 1058 | 311296
counters | 12582912 | 0 | 0 | NaN | 0 | 0 | 0 | 0
keys | 25165824 | 249751 | 297971 | 0.547795 | 268 | 484 | 543946 | 21978104
rows | 0 | 0 | 0 | NaN | 0 | 0 | 0 | 0
system_views.clients
cqlsh> select * from system_views.clients;
address | port | connection_stage | driver_name | driver_version | hostname | protocol_version | request_count | ssl_cipher_suite | ssl_enabled | ssl_protocol | username
-----------+-------+------------------+----------------------------------------------+----------------+-----------+------------------+---------------+------------------+-------------+--------------+-----------
127.0.0.1 | 43522 | ready | DataStax Node.js Driver for Apache Cassandra | 4.0.0 | localhost | 4 | 423 | null | False | null | anonymous
127.0.0.1 | 43524 | ready | DataStax Node.js Driver for Apache Cassandra | 4.0.0 | localhost | 4 | 419 | null | False | null | anonymous
127.0.0.1 | 43530 | ready | DataStax Node.js Driver for Apache Cassandra | 4.0.0 | localhost | 4 | 418 | null | False | null | anonymous
127.0.0.1 | 43536 | ready | DataStax Node.js Driver for Apache Cassandra | 4.0.0 | localhost | 4 | 419 | null | False | null | anonymous
127.0.0.1 | 43540 | ready | DataStax Node.js Driver for Apache Cassandra | 4.0.0 | localhost | 4 | 419 | null | False | null | anonymous
127.0.0.1 | 43546 | ready | DataStax Node.js Driver for Apache Cassandra | 4.0.0 | localhost | 4 | 418 | null | False | null | anonymous
127.0.0.1 | 43552 | ready | DataStax Node.js Driver for Apache Cassandra | 4.0.0 | localhost | 4 | 419 | null | False | null | anonymous
127.0.0.1 | 43556 | ready | DataStax Node.js Driver for Apache Cassandra | 4.0.0 | localhost | 4 | 419 | null | False | null | anonymous
system_views.sstable_tasks
nodetool compactionstats
cqlsh> select * from system_views.sstable_tasks;
keyspace_name | table_name | task_id | kind | progress | total | unit
---------------+------------+--------------------------------------+------------+----------+----------+-------
keyspace1 | standard1 | 07efc380-f5cb-11e8-a574-a73cf9e584bb | compaction | 26840071 | 78425364 | bytes
$ nodetool enablefullquerylog --path /tmp/simple
$ cqlsh -e "INSERT INTO simple.tbl (k, v) values (2, 3)"
$ cqlsh -e "SELECT v from simple.tbl where k = 2"
$ nodetool disablefullquerylog
$ tools/bin/fqltool dump /tmp/simple
...
Type: single-query
Query start time: 1543694938788
Protocol version: 4
Generated timestamp:-9223372036854775808
Generated nowInSeconds:1543694938
Query: INSERT INTO simple.tbl (k, v) values (2, 3);
Values:
...
Type: single-query
Query start time: 1543694960336
Protocol version: 4
Generated timestamp:-9223372036854775808
Generated nowInSeconds:1543694960
Query: SELECT v from simple.tbl where k = 2;
Values:
$ tools/bin/fqltool replay
--keyspace simple
--results /tmp/results1 \
--store-queries /tmp/queries \
--target 127.0.0.1 /tmp/simple
$ bin/cqlsh -e "drop table simple.tbl"
$ tools/bin/fqltool replay --keyspace simple \
--results /tmp/results2 \
--target 127.0.0.1 /tmp/simple
$ tools/bin/fqltool compare --queries /tmp/queries \
/tmp/results1/127.0.0.1 /tmp/results2/127.0.0.1
Query against /tmp/results2/127.0.0.1 failure:
Query = INSERT INTO simple.tbl (k, v) values (2, 3);, Values =
Message: table tbl does not exist
...
Query against /tmp/results2/127.0.0.1 failure:
Query = SELECT v from simple.tbl where k = 2;, Values =
Message: table tbl does not exist
MISMATCH:
Query = SELECT v from simple.tbl where k = 2;, Values =
Results:
/tmp/results1/127.0.0.1: 00000003
/tmp/results2/127.0.0.1: null
QUORUM
consistencyQUORUM
can only tolerate 1 node being down
CREATE KEYSPACE tr WITH replication = {
'class': 'NetworkTopologyStrategy',
'datacenter1': '5/2'
};
Two new and exciting GCs for Cassandra
Both are concurrent compacting GCs that focus on reducing pause times to sub milliseconds
GC | mean | 95p | 99p | 999p |
---|---|---|---|---|
CMS | 3.0ms | 2.7ms | 76.6ms | 187.4ms |
G1 | 5.9ms | 0.7ms | 192.0ms | 349.7ms |
ZGC | 0.9ms | 0.5ms | 3.5ms | 149.0ms |
This could take a bit of time to go over, if we have time later and anyone is interested we can come back to this
Incremental repair has a number of shortcomings:
General advisement is to use subrange repairs instead*.
ALTER TABLE x WITH speculative_retry='MIN(99P,50ms)'
= speculate on the minimum of 99p response time and 50msnodetool
nodetool profileload
cqlsh> nodetool profileload
Frequency of reads by partition:
Table Partition Count +/-
basic.wide row1 75424 0
basic.cas p1 656 0
system.paxos 7031 550 0
Frequency of writes by partition:
Table Partition Count +/-
system.paxos 7031 585 0
basic.cas p1 112 0
Frequency of cas contentions by partition:
Table Partition Count +/-
basic.cas p1 76 0
Max mutation size by partition:
Table Partition Bytes
basic.wide row0 1056
basic.wide row7 1056
Longest read query times:
Query Microseconds
SELECT * FROM basic.wide WHERE key = row1 LIMIT 5000 25681
SELECT * FROM basic.wide WHERE key = row1 LIMIT 5000 16131
automatic_sstable_upgrade
)+ - * / ^
)