lsb_release -r可以看到操作系统版本是20.04,uname -r可以看到内核版本是5.5.19。

sudo apt install -y docker-compose安装docker-compose。

完成之后如下图:

cd /opt/n9e/docker/进入到/opt/n9e/docker/里边。

docker-compose up -d进行部署。

完成之后如下图:

docker ps发现nightingale的状态是Restarting。

docker logs 8acc8d9e8154发现错误是[error] failed to initialize database, got error Error 1045: Access denied for user 'root'@'localhost' (using password: YES)。

cd /opt/n9e/docker/进入到docker-compose.yaml文件放置的目录下。

把skip-grant-tables添加到./mysqletc/my.cnf里边。

docker restart mysql重新启动mysql容器。

docker exec -it 3bfd50db8d39 bash进入到mysql容器里边。

在容器里边输入mysql命令。

在容器里边输入mysql提示符内输入grant all privileges on *.* to 'root'@'local' identified by 'Good#1103' with grant option;,发现报错ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'identified by 'Good#1103' with grant option' at line 1。

select user,host from mysql.user;看一下上边拼写错误的地方。

flush privileges;更新一下权限,ALTER USER 'root'@'localhost' IDENTIFIED BY 'Good#1103';更改一下密码。

quit;退出容器内的mysql。

exit退出容器。

把./mysqletc/my.cnf里边的skip-grant-tables删除。

docker restart mysql重启容器。

docker ps可以看到所有容器都启动了。

ss -tlnp|grep 17000查看一下监控端口状态,发现有一条数据,说明n9e在容器里边启动成功。

在浏览器中输入ip:端口号,我这里是192.168.0.62:17000,然后按下回车键,就可以跳转到下边的页面,默认用户名为root ,默认密码是root.2020。

登录成功提示暂无数据源,点击前往配置。

然后点击添加。

填上名称和URL,点击测试并保存。

成功添加如下图:

官方部署文档地址是https://flashcat.cloud/docs/content/flashcat-monitor/nightingale-v6/install/intro/
docker-compose stop可以停止所有容器。

此文章为9月Day 17学习笔记,内容来源于极客时间《运维监控系统实战笔记》。