Neo4j数据库使用jmx监控度量指标-[运维监控系统PIGOSS]

前言

        Neo4j是一款NOSQL图形数据库,它是一个嵌入式的、基于磁盘的、具备完全的事务特性的Java持久化引擎,因此可以开启并使用JMX来监控Neo4j数据库的部分度量指标以了解数据库目前的服务运行状态

步骤

一:进入Neo4j的conf目录

[root@neo4j conf]# pwd
/opt/neo4j-enterprise-4.4.4/conf

二:创建JMX权限文件和密码文件

[root@neo4j conf]# cat > /opt/neo4j-enterprise-4.4.4/conf/jmx.access << EOF
monitorRole readonly
EOF
[root@neo4j conf]# chmod 0600 jmx.access
[root@neo4j conf]# cat > /opt/neo4j-enterprise-4.4.4/conf/jmx.password << EOF
monitorRole your_password
EOF
[root@neo4j conf]# chmod 0600 jmx.password

三::修改Neo4j配置文件

[root@neo4j conf]# vim neo4j.conf

… … …

# Open JMX
metrics.jmx.enabled= true
# 指定JMX端口,可以自定义设置,但不要与现有端口冲突
dbms.jvm.additional=-Dcom.sun.management.jmxremote.port=9999
# 是否使用身份验证;设置为”false”时,将不需要身份验证直接连接JMX
dbms.jvm.additional=-Dcom.sun.management.jmxremote.authenticate=true
# 是否使用SSL加密连接;暂不支持SSL加密连接,需要设置为false
dbms.jvm.additional=-Dcom.sun.management.jmxremote.ssl=false
#如果您连接JMX遇到关于主机名的问题,可以取消下一行的注释并启用他(取消注释即可,无需更改)
#dbms.jvm.additional=-Djava.rmi.server.hostname=$THE_NEO4J_SERVER_HOSTNAME
#以下条目必须使用绝对路径
dbms.jvm.additional=-Dcom.sun.management.jmxremote.password.file=/opt/neo4j-enterprise-4.4.4/conf/jmx.password
dbms.jvm.additional=-Dcom.sun.management.jmxremote.access.file=/opt/neo4j-enterprise-4.4.4/conf/jmx.access

四:启动Neo4j数据库

[root@neo4j bin]# ./neo4j start
Directories in use:
home:        /opt/neo4j-enterprise-4.4.4
config:       /opt/neo4j-enterprise-4.4.4/conf
logs:         /opt/neo4j-enterprise-4.4.4/logs
plugins:      /opt/neo4j-enterprise-4.4.4/plugins
import:       /opt/neo4j-enterprise-4.4.4/import
data:         /opt/neo4j-enterprise-4.4.4/data
certificates:   /opt/neo4j-enterprise-4.4.4/certificates
licenses:      /opt/neo4j-enterprise-4.4.4/licenses
run:          /opt/neo4j-enterprise-4.4.4/run
Starting Neo4j.
WARNING: Max 4096 open files allowed, minimum of 40000 recommended. See the Neo4j manual.
Started neo4j (pid:1965). It is available at http://0.0.0.0:7474
There may be a short delay until the server is ready.

测试JMX连接

使用Jconsole测试连接,选择远程连接,并输入连接参数

连接成功

部分Mbean指标展示(以4.4.4版本为例)

1.通用指标

表1。数据库检查点指标
名字描述

neo4j.check_point.events

到目前为止执行的检查点事件的总数

neo4j.check_point.total_time

到目前为止检查指向所花费的总时间

neo4j.check_point.check_point_duration

检查点事件的持续时间

表二。数据库数据指标
名字描述

neo4j.ids_in_use.relationship_type

数据库中存储的不同关系类型的总数

neo4j.ids_in_use.property

数据库中使用的不同属性名称的总数

neo4j.ids_in_use.relationship

数据库中存储的关系总数

neo4j.ids_in_use.node

数据库中存储的节点总数

表3。数据库页面缓存度量
名字描述

neo4j.page_cache.eviction_exceptions

在页面缓存的逐出过程中看到的异常总数

neo4j.page_cache.flushes

页面缓存执行的刷新总数

neo4j.page_cache.unpins

页面缓存执行的页面取消固定的总数

neo4j.page_cache.pins

页面缓存执行的页面固定总数

neo4j.page_cache.evictions

页面缓存执行的页面逐出总数

neo4j.page_cache.page_faults

页面缓存中发生的页面错误总数

neo4j.page_cache.hits

页面缓存中发生的页面命中总数

neo4j.page_cache.hit_ratio

命中数与页面缓存中查找总数的比率

neo4j.page_cache.usage_ratio

已用页数与可用页数的比率

表4。数据库事务度量
名字描述

neo4j.transaction.started

已启动的事务总数

neo4j.transaction.peak_concurrent

并发事务的最高峰

neo4j.transaction.active

当前活动事务的数量

neo4j.transaction.active_read

当前活动读取事务的数量

neo4j.transaction.active_write

当前活动写事务的数量

neo4j.transaction.committed

提交的事务总数

neo4j.transaction.committed_read

提交的读取事务的总数

neo4j.transaction.committed_write

提交的写入事务的总数

neo4j.transaction.rollbacks

回滚的事务总数

neo4j.transaction.rollbacks_read

回滚的读取事务的总数

neo4j.transaction.rollbacks_write

回滚的写事务的总数

neo4j.transaction.terminated

终止的事务总数

neo4j.transaction.terminated_read

终止的读取事务的总数

neo4j.transaction.terminated_write

终止的写入事务的总数

neo4j.transaction.last_committed_tx_id

上次提交的事务的ID

neo4j.transaction.last_closed_tx_id

上次关闭的交易的ID

表5。密码度量
名字描述

neo4j.cypher.replan_events

Cypher决定重新计划查询的总次数

neo4j.cypher.replan_wait_time

查询重新计划之间等待的总秒数

表6。数据库日志循环度量
名字描述

neo4j.log_rotation.events

到目前为止执行的事务日志循环总数

neo4j.log_rotation.total_time

到目前为止循环事务日志所花费的总时间

neo4j.log_rotation.log_rotation_duration

日志循环事件的持续时间

表7。螺栓规格
名字描述

neo4j.bolt.sessions_started

自该实例启动以来启动的Bolt会话总数。这包括成功的和失败的会话(不推荐使用,请改用connections_opened)。

neo4j.bolt.connections_opened

自该实例启动以来打开的螺栓连接总数。这包括成功和失败的连接。

neo4j.bolt.connections_closed

自该实例启动以来关闭的螺栓连接总数。这包括正常端接和异常端接。

neo4j.bolt.connections_running

当前正在执行的螺栓连接的总数。

neo4j.bolt.connections_idle

闲置的螺栓连接总数。

neo4j.bolt.messages_received

自该实例启动以来通过Bolt接收的消息总数。

neo4j.bolt.messages_started

自该实例启动后开始处理的消息总数。这与messages received不同,因为此计数器跟踪有多少接收的消息已被工作线程接受。

neo4j.bolt.messages_done

自该实例启动以来已完成处理的消息总数。这包括成功、失败和忽略的螺栓消息。

neo4j.bolt.messages_failed

自该实例启动以来处理失败的消息总数。

neo4j.bolt.accumulated_queue_time

消息等待工作线程所花费的累计时间。

neo4j.bolt.accumulated_processing_time

工作线程处理消息所花费的累计时间。

表8。服务器指标
名字描述

neo4j.server.threads.jetty.idle

jetty池中空闲线程的总数

neo4j.server.threads.jetty.all

jetty池中的线程总数(空闲和繁忙)

2.特定于因果聚类的指标

表9。核心指标
名字描述

neo4j.causal_clustering.core.append_index

筏形日志的附加索引

neo4j.causal_clustering.core.commit_index

RAFT日志的提交索引

neo4j.causal_clustering.core.term

该服务器的RAFT术语

neo4j.causal_clustering.core.tx_retries

交易重试次数

neo4j.causal_clustering.core.is_leader

这个服务器是领导吗?

neo4j.causal_clustering.core.in_flight_cache.total_bytes

运行中的缓存总字节数

neo4j.causal_clustering.core.in_flight_cache.max_bytes

高速缓存最大字节数

neo4j.causal_clustering.core.in_flight_cache.element_count

运行中的缓存元素计数

neo4j.causal_clustering.core.in_flight_cache.max_elements

动态缓存最大元素数

neo4j.causal_clustering.core.in_flight_cache.hits

运行中的缓存命中

neo4j.causal_clustering.core.in_flight_cache.misses

高速缓存未命中

neo4j.causal_clustering.core.message_processing_delay

RAFT消息接收和处理之间的延迟

neo4j.causal_clustering.core.message_processing_timer

RAFT消息处理定时器

neo4j.causal_clustering.core.replication_new

Raft复制新请求计数

neo4j.causal_clustering.core.replication_attempt

Raft复制尝试计数

neo4j.causal_clustering.core.replication_success

Raft复制成功计数

neo4j.causal_clustering.core.replication_fail

Raft复制失败计数

表10。读取副本指标
名字描述

neo4j.causal_clustering.read_replica.pull_updates

此实例发出的请求总数

neo4j.causal_clustering.read_replica.pull_update_highest_tx_id_requested

此实例在请求更新中请求的最高事务id

neo4j.causal_clustering.read_replica.pull_update_highest_tx_id_received

此实例在上次提取更新中提取的最高事务id

3.Java虚拟机指标

这些指标依赖于环境,并且它们可能在不同的硬件和JVM配置上有所不同。通常,这些指标将显示有关垃圾收集的信息(例如事件数量和收集时间)、内存池和缓冲区,以及运行的活动线程数量。

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值