Cassandra 4.0虚拟表如何读取数据?

问题描述

从文档中可以看出,在cassandra 4.0中,虚拟表是只读的,不允许写入。

当前有2个vtable可用,即system_views和system_virtual_schema,它包含17个表。

其中包含客户端,缓存,设置等数据。

这些数据究竟是从vtables那里来的?

以下是所有vtable:https://github.com/apache/cassandra/tree/64b338cbbce6bba70bda696250f3ccf4931b2808/src/java/org/apache/cassandra/db/virtual

PS:我经历了cassandra.yaml 参考:https://cassandra.apache.org/doc/latest/new/virtualtables.html

解决方法

虚拟表存储的指标数据以前只能通过JMX获得,现在也可以通过CQL获得。

例如,system_view.clients表跟踪客户端连接上的元数据,包括(但不限于):

  • 客户端的远程IP地址
  • 登录用户(如果启用了身份验证)
  • 协议版本
  • 驱动程序名称和版本
  • 是否使用SSL等

该数据可通过JMX和nodetool clientstats获得,现在可通过CQL检索(我在https://community.datastax.com/questions/6113/中对此进行了介绍)。干杯!

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...