一、系统与版本信息
# 系统版本
cat /etc/os-release
# CPU 与内存
lscpu | grep 'Model name'
free -h
# 磁盘空间
df -h
# ArangoDB 版本
arangod --version
# Erlang 版本(仅适用于某些内部组件依赖)
erl -version 2>/dev/null || echo "Erlang not installed"
# 运行用户与服务状态
ps -ef | grep arangod
systemctl status arangodb3
二、服务健康状态
2.1 单机模式
# 查看服务是否正常监听
ss -lntp | grep arangod
# HTTP 健康检查(需有认证)
curl -u root:密码 http://localhost:8529/_api/version
2.2 集群模式
# 检查 Agency 状态(协调器节点执行)
curl -u root:密码 http://localhost:8529/_admin/cluster/health | jq
# 查看集群节点状态
curl -u root:密码 http://localhost:8529/_admin/cluster/health | jq '.Health | to_entries[] | {Server:.key,Status:.value.Status,Endpoint:.value.Endpoint,Role:.value.Role}'
三、资源与性能指标
3.1 ArangoDB 内部统计
# 服务器统计信息
curl -u root:密码 http://localhost:8529/_admin/statistics
# 关键性能指标(请求数、I/O、缓存命中率)
curl -u root:密码 http://localhost:8529/_admin/statistics-description | jq '.groups[] | {group:.group, figures:.figures[].identifier}'
3.2 连接与会话
# 当前活动连接数
curl -u root:密码 http://localhost:8529/_admin/statistics | jq '.system.http.requests_total'
四、数据库与集合状态
# 查看所有数据库
arangosh --server.endpoint tcp://127.0.0.1:8529 --server.username root --server.password 密码 --javascript.execute-string "db._databases();"
# 查看集合信息
arangosh --server.endpoint tcp://127.0.0.1:8529 --server.username root --server.password 密码 --javascript.execute-string "db._collections().map(c => ({ name: c.name(), count: c.count(), type: c.type() }));"
# 查看索引使用情况
arangosh --server.username root --server.password 密码 --javascript.execute-string "db._collections().forEach(c => print(c.name(), JSON.stringify(c.getIndexes())));"
五、配置与日志巡检
# 查看配置文件路径
ps -ef | grep arangod | grep conf
# 检查配置内容(如数据目录、端口、日志)
cat /etc/arangodb3/arangod.conf | grep -E "data|endpoint|log"
# 日志关键字检查
grep -E "ERROR|WARN|FATAL" /var/log/arangodb3/arangod.log | tail -n 20
六、安全与备份检查
# 用户与权限
arangosh --server.username root --server.password 密码 --javascript.execute-string "require('@arangodb/users').all();"
# 检查 TLS/SSL 启用
grep -E "ssl|https" /etc/arangodb3/arangod.conf
# 备份情况
ls -lh /var/lib/arangodb3/backups/
# 使用 arangodump 验证备份可行性
arangodump --server.username root --server.password 密码 --output-directory /tmp/arangodump-test
七、集群巡检要点(如启用 Cluster)
| 检查项 | 命令示例 |
|---|
| Agency 状态 | curl -u root:密码 http://localhost:8529/_admin/cluster/health |
| Coordinators | curl -u root:密码 http://localhost:8529/_admin/cluster/numberOfCoordinators |
| DBServers | curl -u root:密码 http://localhost:8529/_admin/cluster/numberOfDBServers |
| Shard 分布 | curl -u root:密码 http://localhost:8529/_admin/cluster/shardDistribution |
| 集群日志 | /var/log/arangodb3/arangod.log、/var/log/arangodb3/arangosync.log |