我对cassandra有意见:
if I do nodetool -h 10.169.20.8 cfstats name.name -H
我得到的结果和统计是这样的:
Read Count: 0
Read Latency: NaN ms.
Write Count: 739812
Write Latency: 0.038670616318740435 ms.
Pending Flushes: 0
Table: name
SSTable count: 10
Space used (live): 1.48 GB
Space used (total): 1.48 GB
Space used by snapshots (total): 0 bytes
Off heap memory used (total): 3.04 MB
SSTable Compression Ratio: 0.5047407001982581
Number of keys (estimate): 701190
Memtable cell count: 22562
Memtable data size: 14.12 MB
Memtable off heap memory used: 0 bytes
Memtable switch count: 7
Local read count: 0
Local read latency: NaN ms
Local write count: 739812
Local write latency: 0.043 ms
Pending flushes: 0
Bloom filter false positives: 0
Bloom filter false ratio: 0.00000
Bloom filter space used: 2.39 MB
Bloom filter off heap memory used: 2.39 MB
Index summary off heap memory used: 302.03 KB
Compression metadata off heap memory used: 366.3 KB
Compacted partition minimum bytes: 87 bytes
Compacted partition maximum bytes: 3.22 MB
Compacted partition mean bytes: 2.99 KB
Average live cells per slice (last five minutes): 1101.2357892212697
Maximum live cells per slice (last five minutes): 1109
Average tombstones per slice (last five minutes): 271.6848030693603
Maximum tombstones per slice (last five minutes): 1109
Dropped Mutations: 0 bytes为什么tombstones的统计数据不是0?我们这里只写Cassandra,没有人删除记录。我们不使用TTL,设置为默认设置。
第二个问题(可能与这个问题有关)-表的行数随机变化,我们不知道是怎么回事。
发布于 2016-10-01 05:30:48
我不确定有没有办法解释这些墓碑--如果你不做任何删除的话。
我可以提供两种方法来尝试和分析这一点-也许这将有助于更好地理解how是什么以及如何how。
有一个名为sstable2json的工具-它允许获取sstable并将其转储到json -
例如,对于以下架构
cqlsh> describe schema;
CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'} AND durable_writes = true;
CREATE TABLE test.t1 (
key text PRIMARY KEY,
value text
) WITH bloom_filter_fp_chance = 0.01
AND caching = '{"keys":"ALL", "rows_per_partition":"NONE"}'
AND comment = ''
AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'}
AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'}
AND dclocal_read_repair_chance = 0.1
AND default_time_to_live = 0
AND gc_grace_seconds = 864000
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99.0PERCENTILE';在具有完整分区的逻辑删除的sstable文件上运行sstable2json提供了以下内容
[
{"key": "key",
"metadata": {"deletionInfo": {"markedForDeleteAt":1475270192779047,"localDeletionTime":1475270192}},
"cells": []}
]在这种情况下,markjer用于使用"key“的分区。
您可以使用的另一种方法(假设tombstone计数正在增加)是使用tcpdump,然后使用wireshark对其进行分析。来自ScyllaDB的Benoit Canet为wireshark贡献了支持CQL的分析器,该分析器现在是最新的稳定版本2.2.0 (https://www.wireshark.org/docs/relnotes/wireshark-2.2.0.html)
请注意,cql删除实际上可以在两种类型中找到:查询和准备(如果删除是使用准备好的语句完成的)。
如果它们是通过预准备语句完成的,则可能需要删除CQL连接,以确保捕获具有预准备语句的特定数据包。
以下是wireshark捕获上述delete语句的示例

发布于 2016-10-02 18:47:00
注意:有时可以使用预准备语句中的空值绑定来创建墓碑- http://thelastpickle.com/blog/2016/09/15/Null-bindings-on-prepared-statements-and-undesired-tombstone-creation.html
发布于 2016-10-03 22:03:56
在列中写入的值与删除相同,并导致逻辑删除。Wait... Say What.
https://stackoverflow.com/questions/39796635
复制相似问题