Cassandra

本章节为 Cloud Insight 支持的平台服务的文档的示例。

目前能够想到的章节分为以下几个部分:

  • 支持的性能指标
  • 如何配置 Cassandra 监控
  • 常见的问题

性能指标

Cloud Insight 采集 Cassandra 以下性能指标:

  • cassandra.db.bloom_filter_disk_space_used
  • cassandra.db.bloom_filter_false_positives
  • cassandra.db.bloom_filter_false_ratio
  • cassandra.db.completed_tasks
  • cassandra.db.compression_ratio
  • cassandra.db.exception_count
  • cassandra.db.key_cache_recent_hit_rate
  • cassandra.db.live_disk_space_used
  • cassandra.db.live_ss_table_count
  • cassandra.db.load
  • cassandra.db.max_row_size
  • cassandra.db.mean_row_size
  • cassandra.db.memtable_columns_count
  • cassandra.db.memtable_data_size
  • cassandra.db.memtable_switch_count
  • cassandra.db.min_row_size
  • cassandra.db.range_operations
  • cassandra.db.read_operations
  • cassandra.db.recent_read_latency_micros
  • cassandra.db.recent_write_latency_micros
  • cassandra.db.total_disk_space_used
  • cassandra.db.total_range_latency_micros
  • cassandra.db.total_read_latency_micros
  • cassandra.db.total_write_latency_micros
  • cassandra.db.update_interval
  • cassandra.db.write_count
  • cassandra.db.write_operations
  • cassandra.internal.active_count
  • cassandra.internal.completed_tasks
  • cassandra.internal.currently_blocked_tasks
  • cassandra.internal.total_blocked_tasks
  • cassandra.net.total_timeouts

配置 Cassandra 监控

JMX

OneAPM Cloud Insight Agent 通过 JMX 获取 Cassandra 中的性能指标。

由于每个实体最多可以监控 350 个性能指标,所以您需要按照下方的配置方法,修改配置文件来确定自己需要哪些指标。

编辑配置文件

编辑配置文件 conf.d/cassandra.yaml,使 Cloud Insight Agent 可以与 Cassandra 通信。

instances:
  - host: localhost
    port: 7199
    user: username
    password: password
    name: cassandra_instance
    #trust_store_path: /path/to/trustStore.jks # Optional, should be set if ssl is enabled
    #trust_store_password: password
    #java_bin_path: /path/to/java #Optional, should be set if the agent cannot find your java executable

# List of metrics to be collected by the integration

init_config:
  conf:
    - include:
        domain: org.apache.cassandra.db
        attribute:
          - BloomFilterDiskSpaceUsed
          - BloomFilterFalsePositives
          - BloomFilterFalseRatio
          - Capacity
          - CompressionRatio
          - CompletedTasks
          - ExceptionCount
          - Hits
          - RecentHitRate
          - RowCacheRecentHitRate
          - KeyCacheRecentHitRate
          - LiveDiskSpaceUsed
          - LiveSSTableCount
          - Load
          - MaxRowSize
          - MeanRowSize
          - MemtableColumnsCount
          - MemtableDataSize
          - MemtableSwitchCount
          - MinRowSize
          - ReadCount
          - Requests
          - Size
          - TotalDiskSpaceUsed
          - TotalReadLatencyMicros
          - TotalWriteLatencyMicros
          - UpdateInterval
          - WriteCount
          - PendingTasks
      exclude:
        keyspace: system
        attribute:
          - MinimumCompactionThreshold
          - MaximumCompactionThreshold
          - RowCacheKeysToSave
          - KeyCacheSavePeriodInSeconds
          - RowCacheSavePeriodInSeconds
          - PendingTasks
          - Scores
          - RpcTimeout
    - include:
        domain: org.apache.cassandra.internal
        attribute:
          - ActiveCount
          - CompletedTasks
          - CurrentlyBlockedTasks
          - TotalBlockedTasks
    - include:
        domain: org.apache.cassandra.net
        attribute:
          - TotalTimeouts

重启 Agent

重启 OneAPM Cloud Insight Agent,使配置生效。

您也可以通过查看 Agent Info 信息,来验证配置是否成功。当出现以下信息,则代表安装成功。

Checks
======

[...]

cassandra
---------
  - instance #0 [OK]
  - Collected 8 metrics & 0 events

常见问题