Nebula Dashboard 修改PromQL后,未生效

提问参考模版:

  • nebula 版本:v2.0.1
  • 部署方式(分布式 / 单机 / Docker / DBaaS):分布式
  • 是否为线上版本:Y
  • 硬件信息
    • 磁盘( 推荐使用 SSD)
    • CPU、内存信息
  1. 修改/app/assets/utils/PromQL.ts 中的query
disk_used: 'node_filesystem_size_bytes{mountpoint=~"/mnt|/mnt/data",fstype!="rootfs"} - node_filesystem_avail_bytes{mountpoint=~"/mnt|/mnt/data",fstype!="rootfs"}',
  disk_free: 'node_filesystem_avail_bytes{mountpoint=~"/mnt|/mnt/data",fstype!="rootfs"}',
  // disk_readbytes: 'irate(node_disk_read_bytes_total{device=~"(sd|nvme|hd)[a-z0-9]*"}[1m])',
  disk_readbytes: 'irate(node_disk_read_bytes_total{device=~"vdb"}[1m])',
  disk_writebytes: 'irate(node_disk_written_bytes_total{device=~"vdb"}[1m])',
  disk_readiops: 'irate(node_disk_reads_completed_total{device=~"vdb"}[1m])',
  disk_writeiops: 'irate(node_disk_writes_completed_total{device=~"vdb"}[1m])',
  inode_utilization: '(1- (node_filesystem_files_free{mountpoint=~"/mnt|/mnt/data",fstype!="rootfs"}) / (node_filesystem_files{mountpoint=~"/mnt|/mnt/data",fstype!="rootfs"})) * 100',
  disk_size: 'node_filesystem_size_bytes{mountpoint=~"/mnt|/mnt/data",fstype!="rootfs"}',

修改后的每个query 我都在Prometheus 中check 了,可以查询到,如下

  1. npm run stop
  2. npm run start

观察到Disk 相关的监控还是没有发生变化,如下, 是还需要修改什么参数吗?

改完有重新build,重新部署么?

没有重新build,只是重启了服务,要重新build?

对的,因为我们用了typescript语法,需要重新build一下:handshake:

1 个赞

@jerry.liang 我要继续问一下了,7003 端口不能访问,步骤如下:
我clone 了https://github.com/vesoft-inc/nebula-dashboard 最新的代码

  1. vendor folder下添加了nebula-http-gateway 重新启动
  2. 现在8090、9090、9100、9200 服务都已经正常启动
  3. 修改了static/custom.json的配置如下:
{
    "connection": {
        "ip": "10.0.7.140",
        "port": 9669
    },
    "alias": {
        "ip:port": "instance1"
    },
    "chartBaseLine": {

    }
}
  1. github install,启动命令如下, 不再是npm run start,dev 的端口是7003
$ npm install
$ npm run dev

报错:

[root@nebula-server-5 nebula-dashboard-1.0.1]# npm run dev

> nebula-graph-dashboard@1.0.1 dev /mnt/file/nebulaDashboard/nebula-dashboard-1.0.1
> egg-bin dev --port=7003 -r egg-ts-helper/register

[egg-ts-helper] create typings/app/controller/index.d.ts (1ms)
[egg-ts-helper] create typings/app/middleware/index.d.ts (1ms)
[egg-ts-helper] create typings/config/index.d.ts (13ms)
[egg-ts-helper] create typings/config/plugin.d.ts (3ms)
[egg-ts-helper] create typings/app/index.d.ts (0ms)
2021-09-06 16:18:48,396 INFO 10304 [master] node version v14.17.5
2021-09-06 16:18:48,397 INFO 10304 [master] egg version 2.29.4
Error: ENOSPC: System limit for number of file watchers reached, watch '/mnt/file/nebulaDashboard/nebula-dashboard-1.0.1/app/controller'
    at FSWatcher.<computed> (internal/fs/watchers.js:218:26)
    at Object.watch (fs.js:1582:34)
    at createFsWatchInstance (/mnt/file/nebulaDashboard/nebula-dashboard-1.0.1/node_modules/chokidar/lib/nodefs-handler.js:38:15)
    at setFsWatchListener (/mnt/file/nebulaDashboard/nebula-dashboard-1.0.1/node_modules/chokidar/lib/nodefs-handler.js:81:15)
    at FSWatcher.NodeFsHandler._watchWithNodeFs (/mnt/file/nebulaDashboard/nebula-dashboard-1.0.1/node_modules/chokidar/lib/nodefs-handler.js:233:14)
    at FSWatcher.NodeFsHandler._handleDir (/mnt/file/nebulaDashboard/nebula-dashboard-1.0.1/node_modules/chokidar/lib/nodefs-handler.js:429:19)
    at FSWatcher.<anonymous> (/mnt/file/nebulaDashboard/nebula-dashboard-1.0.1/node_modules/chokidar/lib/nodefs-handler.js:477:19)
    at FSWatcher.<anonymous> (/mnt/file/nebulaDashboard/nebula-dashboard-1.0.1/node_modules/chokidar/lib/nodefs-handler.js:482:16)
    at FSReqCallback.oncomplete (fs.js:193:5)
2021-09-06 16:18:48,427 ERROR 10304 [master] exit with code:1
Error: /mnt/file/nebulaDashboard/nebula-dashboard-1.0.1/node_modules/egg-bin/lib/start-cluster {"typescript":true,"port":7003,"tscompiler":"ts-node/register","workers":1,"baseDir":"/mnt/file/nebulaDashboard/nebula-dashboard-1.0.1","framework":"/mnt/file/nebulaDashboard/nebula-dashboard-1.0.1/node_modules/egg"} exit with code 1
    at ChildProcess.<anonymous> (/mnt/file/nebulaDashboard/nebula-dashboard-1.0.1/node_modules/common-bin/lib/helper.js:56:21)
    at Object.onceWrapper (events.js:520:26)
    at ChildProcess.emit (events.js:400:28)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12) {
  code: 1
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nebula-graph-dashboard@1.0.1 dev: `egg-bin dev --port=7003 -r egg-ts-helper/register`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nebula-graph-dashboard@1.0.1 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-09-06T08_18_48_462Z-debug.log
[root@nebula-server-5 nebula-dashboard-1.0.1]# 2021-09-06 16:18:49,204 ERROR 10326 [agent_worker] receive disconnect event on child_process fork mode, exiting with code:110
2021-09-06 16:18:49,205 WARN 10326 [egg-view-assets] dev server will be killed
2021-09-06 16:18:49,210 ERROR 10326 nodejs.ENOSPCError: ENOSPC: System limit for number of file watchers reached, watch '/mnt/file/nebulaDashboard/nebula-dashboard-1.0.1/app'
    at FSWatcher.<computed> (internal/fs/watchers.js:218:26)
    at Object.watch (fs.js:1582:34)
    at Walk.<anonymous> (/mnt/file/nebulaDashboard/nebula-dashboard-1.0.1/node_modules/wt/index.js:183:20)
    at Walk.emit (events.js:400:28)
    at /mnt/file/nebulaDashboard/nebula-dashboard-1.0.1/node_modules/ndir/lib/ndir.js:107:16
    at FSReqCallback.oncomplete (fs.js:193:5)
errno: -28
syscall: "watch"
code: "ENOSPC"
path: "/mnt/file/nebulaDashboard/nebula-dashboard-1.0.1/app"
filename: "/mnt/file/nebulaDashboard/nebula-dashboard-1.0.1/app"
dir: "/mnt/file/nebulaDashboard/nebula-dashboard-1.0.1/app"
name: "ENOSPCError"
pid: 10326
hostname: nebula-server-5

2021-09-06 16:18:49,211 ERROR 10326 nodejs.ENOSPCError: ENOSPC: System limit for number of file watchers reached, watch '/mnt/file/nebulaDashboard/nebula-dashboard-1.0.1/config'
    at FSWatcher.<computed> (internal/fs/watchers.js:218:26)
    at Object.watch (fs.js:1582:34)
    at Walk.<anonymous> (/mnt/file/nebulaDashboard/nebula-dashboard-1.0.1/node_modules/wt/index.js:183:20)
    at Walk.emit (events.js:400:28)
    at /mnt/file/nebulaDashboard/nebula-dashboard-1.0.1/node_modules/ndir/lib/ndir.js:107:16
    at FSReqCallback.oncomplete (fs.js:193:5)
errno: -28
syscall: "watch"
code: "ENOSPC"
path: "/mnt/file/nebulaDashboard/nebula-dashboard-1.0.1/config"
filename: "/mnt/file/nebulaDashboard/nebula-dashboard-1.0.1/config"
dir: "/mnt/file/nebulaDashboard/nebula-dashboard-1.0.1/config"
name: "ENOSPCError"
pid: 10326
hostname: nebula-server-5

2021-09-06 16:18:49,213 ERROR 10326 [agent_worker] exit with code:110

  1. 如果npm run start 启动端口7001, 不报错,但是浏览器访问
Internal Server Error, real status: 500

看了proxy.ts 并没有写死

System limit for number of file watchers reached, 看起来像是文件数太多了,试试这个react项目启动报错:Error: ENOSPC: System limit for number of file watchers reached-CSDN博客

感谢,这个问题解决了,但是npm run dev 之后前端一直再加载中,而且npm run dev 不是daemon 进程

重新安装依赖,npm install, npm run tsc,npm run build,npm run start这样一套

嗯嗯,npm run dev是运行开发环境,daemon的是npm run start :handshake:

此话题已在最后回复的 7 天后被自动关闭。不再允许新回复。