Nightingale——夜莺监控版本升级

2024-08-16 13:12:58 浏览数 (1)

前言

部署了滴滴开源的夜莺监控系统,部署的时候安装的是1.4.0版本,现在版本已经更新到2.6.1,所以特地升级下。

步骤

拉取代码

拉取的时候,记得在Go的工作空间中拉取

代码语言:javascript复制
git clone --branch v2.6.1 git@github.com:didi/nightingale.git

编译代码

代码语言:javascript复制
root@King:/mnt/d/wamp/www/GoLearn/src/github.com/n9e/nightingale# ./control build

编译报错

代码语言:javascript复制
./control: line 2: $'r': command not found
./control: line 5: $'r': command not found
./control: line 7: cd: $'/mnt/d/wamp/www/GoLearn/src/github.com/n9e/nightingalerr': No such file or directory
./control: line 8: $'r': command not found
./control: line 9: syntax error near unexpected token `$'r''
'/control: line 9: `usage()

解决方法

代码语言:javascript复制
## 原因文件编码问题,设置为unix即可
wangyang@King:/mnt/d/wamp/www/GoLearn/src/github.com/n9e/nightingale$ vi control
:set ff=unix

编译报错

代码语言:javascript复制
# github.com/open-falcon/rrdlite
exec: "gcc": executable file not found in $PATH

解决方法

代码语言:javascript复制
##新环境忘记安装gcc
root@King:/mnt/d/wamp/www/GoLearn/src/github.com/n9e/nightingale# apt-get update
root@King:/mnt/d/wamp/www/GoLearn/src/github.com/n9e/nightingale# apt-get install -y build-essential

编译完成

代码语言:javascript复制
## 出现一些警告说_BSD_SOURCE和_SVID_SOURCE已经舍弃,请使用_DEFAULT_SOURCE
# github.com/open-falcon/rrdlite
In file included from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33:0,
                 from /usr/include/stdlib.h:25,
                 from rrdfunc.c:1:
/usr/include/features.h:184:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
 # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"

## 编译完成后会生成相应的二进制文件包
root@King:/mnt/d/wamp/www/GoLearn/src/github.com/n9e/nightingale# ll -h n9e*
-rwxrwxrwx 1 wangyang wangyang 22M Jun 11 02:49 n9e-collector*
-rwxrwxrwx 1 wangyang wangyang 21M Jun 11 02:49 n9e-index*
-rwxrwxrwx 1 wangyang wangyang 21M Jun 11 02:49 n9e-judge*
-rwxrwxrwx 1 wangyang wangyang 22M Jun 11 02:48 n9e-monapi*
-rwxrwxrwx 1 wangyang wangyang 21M Jun 11 02:49 n9e-transfer*
-rwxrwxrwx 1 wangyang wangyang 20M Jun 11 02:49 n9e-tsdb*

升级数据库

升级SQL

部署服务

将我们编译好的二进制文件扔到/usr/local/n9e/执行以下命令 | 当然如果前端要更新的话千万不要忘记更新pub目录下的前端资源文件

代码语言:javascript复制
chmod  x n9e-*
./control stop all
./control start all
./n9e-collector -v
2020/06/13 01:48:37 maxprocs: Leaving GOMAXPROCS=4: CPU quota undefined
Version: 2.6.1
Git Commit Hash: 2d0fa2d26fe79f000701124361798ae40bc1257b
UTC Build Time: 2020-06-10_06:49:12PM

0 人点赞