云原生之使用docker部署uptime-kuma服务器监控面板

简介: 云原生之使用docker部署uptime-kuma服务器监控面板

一、uptime-kuma介绍

uptime-kuma是一款开源的、多功能的服务器监控面板 。

二、检查docker环境

1.检查docker状态

[root@jeven ~]# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2022-12-02 04:34:05 CST; 5 days ago
     Docs: https://docs.docker.com
 Main PID: 10004 (dockerd)
    Tasks: 136
   Memory: 3.1G
   CGroup: /system.slice/docker.service
           ├─  8186 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8987 -container-ip 172.17.0.3 -container-port 3001
           ├─  8192 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8987 -container-ip 172.17.0.3 -container-port 3001
           ├─ 10004 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
           ├─ 65292 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8777 -container-ip 172.17.0.4 -container-port 80
           ├─ 65298 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8777 -container-ip 172.17.0.4 -container-port 80
           ├─117192 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 453 -container-ip 192.168.240.2 -container-port 443
           ├─117198 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 453 -container-ip 192.168.240.2 -container-port 443
           ├─117211 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8161 -container-ip 192.168.240.2 -container-port 81
           ├─117217 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8161 -container-ip 192.168.240.2 -container-port 81
           ├─117229 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8061 -container-ip 192.168.240.2 -container-port 80
           ├─117235 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8061 -container-ip 192.168.240.2 -container-port 80
           ├─122772 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 443 -container-ip 172.24.0.2 -container-port 443
           ├─122778 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 443 -container-ip 172.24.0.2 -container-port 443
           ├─122792 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8023 -container-ip 172.24.0.2 -container-port 80
           ├─122797 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8023 -container-ip 172.24.0.2 -container-port 80
           ├─125465 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8133 -container-ip 192.168.16.2 -container-port 80
           ├─125470 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8133 -container-ip 192.168.16.2 -container-port 80
           ├─126264 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8276 -container-ip 172.17.0.2 -container-port 80
           └─126270 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8276 -container-ip 172.17.0.2 -container-port 80

Dec 07 16:07:08 jeven dockerd[10004]: time="2022-12-07T16:07:08.423088936+08:00" level=info msg="Layer sha256:64d536caa03db14629265c6a5553...eaned up"
Dec 07 16:07:08 jeven dockerd[10004]: time="2022-12-07T16:07:08.504084245+08:00" level=info msg="Layer sha256:64d536caa03db14629265c6a5553...eaned up"
Dec 07 16:15:28 jeven dockerd[10004]: time="2022-12-07T16:15:28.183055538+08:00" level=info msg="Container failed to exit within 10s of si...124cf8fc2
Dec 07 16:15:28 jeven dockerd[10004]: time="2022-12-07T16:15:28.230585659+08:00" level=info msg="ignoring event" container=d0fd0c5a50e921c...skDelete"
Dec 07 16:21:23 jeven dockerd[10004]: time="2022-12-07T16:21:23.742077933+08:00" level=info msg="Container failed to exit within 10s of si...dab894fb5
Dec 07 16:21:23 jeven dockerd[10004]: time="2022-12-07T16:21:23.797450110+08:00" level=info msg="ignoring event" container=13b4daa70e01805...skDelete"
Dec 07 22:27:25 jeven dockerd[10004]: time="2022-12-07T22:27:25.797566666+08:00" level=info msg="Pull session cancelled"
Dec 07 22:27:26 jeven dockerd[10004]: time="2022-12-07T22:27:26.872707017+08:00" level=error msg="Not continuing with pull after error: co...canceled"
Dec 07 22:30:25 jeven dockerd[10004]: time="2022-12-07T22:30:25.868361013+08:00" level=info msg="ignoring event" container=64f382767f860bd...skDelete"
Dec 07 22:38:51 jeven dockerd[10004]: time="2022-12-07T22:38:51.981442249+08:00" level=info msg="ignoring event" container=544a3ed21fddcd3...skDelete"
Hint: Some lines were ellipsized, use -l to show in full.
[root@jeven ~]#

2.检查docker版本

[root@jeven kuma]# docker version
Client: Docker Engine - Community
 Version:           20.10.17
 API version:       1.41
 Go version:        go1.17.11
 Git commit:        100c701
 Built:             Mon Jun  6 23:05:12 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.17
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.17.11
  Git commit:       a89b842
  Built:            Mon Jun  6 23:03:33 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.6
  GitCommit:        10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1
 runc:
  Version:          1.1.2
  GitCommit:        v1.1.2-0-ga916309
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

三、下载uptime-kuma镜像

[root@jeven kuma]# docker pull louislam/uptime-kuma:1
1: Pulling from louislam/uptime-kuma
1: Pulling from louislam/uptime-kuma
4b7b4a8876e2: Pull complete 
e05e9bb59438: Pull complete 
911c1003bc81: Pull complete 
00d25b468f79: Pull complete 
acbb79e9e26e: Pull complete 
846ef4780c5d: Pull complete 
d4ca0209da08: Pull complete 
a1370fa12225: Pull complete 
5c67314e6b08: Pull complete 
fcd07c4be961: Pull complete 
Digest: sha256:a84767d7934f833010b886f3dfc57b9d23ca69e85e48f378b28b5c25c5043e1d
Status: Downloaded newer image for louislam/uptime-kuma:1
docker.io/louislam/uptime-kuma:1

四、部署uptime-kuma

1.创建数据目录

[root@jeven ~]# mkdir -p /data/kuma/data
[root@jeven ~]# cd /data/kuma/
[root@jeven kuma]#

2.创建uptime-kuma容器


[root@jeven kuma]# docker run -d --name uptime-kuma --restart=always -p 3001:3001 -v /data/kuma/data:/app/data louislam/uptime-kuma:1
866f04ae1c908290c313dfc97b537ca5f5faa36515493e64a9e5a8e7b635fe97

3.查看uptime-kuma容器状态

[root@jeven kuma]# docker ps
CONTAINER ID   IMAGE                                   COMMAND                  CREATED              STATUS                        PORTS                                                                                                                 NAMES
866f04ae1c90   louislam/uptime-kuma:1                  "/usr/bin/dumb-init …"   About a minute ago   Up About a minute (healthy)   0.0.0.0:3001->3001/tcp, :::3001->3001/tcp

4.查看uptime-kuma容器日志


[root@jeven kuma]# docker logs uptime-kuma 
==> Performing startup jobs and maintenance tasks
==> Starting application with user 0 group 0
Welcome to Uptime Kuma
Your Node.js version: 16
2022-12-07T15:15:07.346Z [SERVER] INFO: Welcome to Uptime Kuma
2022-12-07T15:15:07.346Z [SERVER] INFO: Node Env: production
2022-12-07T15:15:07.346Z [SERVER] INFO: Importing Node libraries
2022-12-07T15:15:07.347Z [SERVER] INFO: Importing 3rd-party libraries
2022-12-07T15:15:07.793Z [SERVER] INFO: Creating express and socket.io instance
2022-12-07T15:15:07.793Z [SERVER] INFO: Server Type: HTTP
2022-12-07T15:15:07.805Z [SERVER] INFO: Importing this project modules
2022-12-07T15:15:07.845Z [NOTIFICATION] INFO: Prepare Notification Providers
2022-12-07T15:15:07.881Z [SERVER] INFO: Version: 1.18.5
2022-12-07T15:15:08.066Z [DB] INFO: Data Dir: ./data/
2022-12-07T15:15:08.066Z [SERVER] INFO: Copying Database
2022-12-07T15:15:08.067Z [SERVER] INFO: Connecting to the Database
2022-12-07T15:15:08.140Z [DB] INFO: SQLite config:
[ {
   
    journal_mode: 'wal' } ]
[ {
   
    cache_size: -12000 } ]
2022-12-07T15:15:08.144Z [DB] INFO: SQLite Version: 3.38.3
2022-12-07T15:15:08.144Z [SERVER] INFO: Connected
2022-12-07T15:15:08.145Z [DB] INFO: Your database version: 0
2022-12-07T15:15:08.145Z [DB] INFO: Latest database version: 10
2022-12-07T15:15:08.145Z [DB] INFO: Database patch is needed
2022-12-07T15:15:08.145Z [DB] INFO: Backing up the database
2022-12-07T15:15:08.146Z [DB] INFO: Patching ./db/patch1.sql
2022-12-07T15:15:08.153Z [DB] INFO: Patched ./db/patch1.sql
2022-12-07T15:15:08.157Z [DB] INFO: Patching ./db/patch2.sql
2022-12-07T15:15:08.160Z [DB] INFO: Patched ./db/patch2.sql
2022-12-07T15:15:08.162Z [DB] INFO: Patching ./db/patch3.sql
2022-12-07T15:15:08.167Z [DB] INFO: Patched ./db/patch3.sql
2022-12-07T15:15:08.169Z [DB] INFO: Patching ./db/patch4.sql
2022-12-07T15:15:08.174Z [DB] INFO: Patched ./db/patch4.sql
2022-12-07T15:15:08.176Z [DB] INFO: Patching ./db/patch5.sql
2022-12-07T15:15:08.180Z [DB] INFO: Patched ./db/patch5.sql
2022-12-07T15:15:08.182Z [DB] INFO: Patching ./db/patch6.sql
2022-12-07T15:15:08.186Z [DB] INFO: Patched ./db/patch6.sql
2022-12-07T15:15:08.188Z [DB] INFO: Patching ./db/patch7.sql
2022-12-07T15:15:08.190Z [DB] INFO: Patched ./db/patch7.sql
2022-12-07T15:15:08.192Z [DB] INFO: Patching ./db/patch8.sql
2022-12-07T15:15:08.194Z [DB] INFO: Patched ./db/patch8.sql
2022-12-07T15:15:08.195Z [DB] INFO: Patching ./db/patch9.sql
2022-12-07T15:15:08.198Z [DB] INFO: Patched ./db/patch9.sql
2022-12-07T15:15:08.200Z [DB] INFO: Patching ./db/patch10.sql
2022-12-07T15:15:08.204Z [DB] INFO: Patched ./db/patch10.sql
2022-12-07T15:15:08.206Z [DB] INFO: Database Patch 2.0 Process
2022-12-07T15:15:08.206Z [DB] INFO: patch-setting-value-type.sql is not patched
2022-12-07T15:15:08.207Z [DB] INFO: patch-setting-value-type.sql is patching
2022-12-07T15:15:08.211Z [DB] INFO: patch-setting-value-type.sql was patched successfully
2022-12-07T15:15:08.211Z [DB] INFO: patch-improve-performance.sql is not patched
2022-12-07T15:15:08.211Z [DB] INFO: patch-improve-performance.sql is patching
2022-12-07T15:15:08.214Z [DB] INFO: patch-improve-performance.sql was patched successfully
2022-12-07T15:15:08.214Z [DB] INFO: patch-2fa.sql is not patched
2022-12-07T15:15:08.214Z [DB] INFO: patch-2fa.sql is patching
2022-12-07T15:15:08.217Z [DB] INFO: patch-2fa.sql was patched successfully
2022-12-07T15:15:08.217Z [DB] INFO: patch-add-retry-interval-monitor.sql is not patched
2022-12-07T15:15:08.217Z [DB] INFO: patch-add-retry-interval-monitor.sql is patching
2022-12-07T15:15:08.220Z [DB] INFO: patch-add-retry-interval-monitor.sql was patched successfully
2022-12-07T15:15:08.220Z [DB] INFO: patch-incident-table.sql is not patched
2022-12-07T15:15:08.220Z [DB] INFO: patch-incident-table.sql is patching
2022-12-07T15:15:08.222Z [DB] INFO: patch-incident-table.sql was patched successfully
2022-12-07T15:15:08.222Z [DB] INFO: patch-group-table.sql is not patched
2022-12-07T15:15:08.222Z [DB] INFO: patch-group-table.sql is patching
2022-12-07T15:15:08.225Z [DB] INFO: patch-group-table.sql was patched successfully
2022-12-07T15:15:08.225Z [DB] INFO: patch-monitor-push_token.sql is not patched
2022-12-07T15:15:08.225Z [DB] INFO: patch-monitor-push_token.sql is patching
2022-12-07T15:15:08.227Z [DB] INFO: patch-monitor-push_token.sql was patched successfully
2022-12-07T15:15:08.227Z [DB] INFO: patch-http-monitor-method-body-and-headers.sql is not patched
2022-12-07T15:15:08.227Z [DB] INFO: patch-http-monitor-method-body-and-headers.sql is patching
2022-12-07T15:15:08.230Z [DB] INFO: patch-http-monitor-method-body-and-headers.sql was patched successfully
2022-12-07T15:15:08.230Z [DB] INFO: patch-2fa-invalidate-used-token.sql is not patched
2022-12-07T15:15:08.231Z [DB] INFO: patch-2fa-invalidate-used-token.sql is patching
2022-12-07T15:15:08.232Z [DB] INFO: patch-2fa-invalidate-used-token.sql was patched successfully
2022-12-07T15:15:08.232Z [DB] INFO: patch-notification_sent_history.sql is not patched
2022-12-07T15:15:08.232Z [DB] INFO: patch-notification_sent_history.sql is patching
2022-12-07T15:15:08.234Z [DB] INFO: patch-notification_sent_history.sql was patched successfully
2022-12-07T15:15:08.235Z [DB] INFO: patch-monitor-basic-auth.sql is not patched
2022-12-07T15:15:08.235Z [DB] INFO: patch-monitor-basic-auth.sql is patching
2022-12-07T15:15:08.239Z [DB] INFO: patch-monitor-basic-auth.sql was patched successfully
2022-12-07T15:15:08.239Z [DB] INFO: patch-add-docker-columns.sql is not patched
2022-12-07T15:15:08.239Z [DB] INFO: patch-add-docker-columns.sql is patching
2022-12-07T15:15:08.268Z [DB] INFO: patch-add-docker-columns.sql was patched successfully
2022-12-07T15:15:08.268Z [DB] INFO: patch-status-page.sql is not patched
2022-12-07T15:15:08.268Z [DB] INFO: patch-status-page.sql is patching
2022-12-07T15:15:08.275Z [DB] INFO: patch-status-page.sql was patched successfully
2022-12-07T15:15:08.275Z [DB] INFO: patch-proxy.sql is not patched
2022-12-07T15:15:08.275Z [DB] INFO: patch-proxy.sql is patching
2022-12-07T15:15:08.293Z [DB] INFO: patch-proxy.sql was patched successfully
2022-12-07T15:15:08.293Z [DB] INFO: patch-monitor-expiry-notification.sql is not patched
2022-12-07T15:15:08.293Z [DB] INFO: patch-monitor-expiry-notification.sql is patching
2022-12-07T15:15:08.296Z [DB] INFO: patch-monitor-expiry-notification.sql was patched successfully
2022-12-07T15:15:08.296Z [DB] INFO: patch-status-page-footer-css.sql is not patched
2022-12-07T15:15:08.297Z [DB] INFO: patch-status-page-footer-css.sql is patching
2022-12-07T15:15:08.302Z [DB] INFO: patch-status-page-footer-css.sql was patched successfully
2022-12-07T15:15:08.302Z [DB] INFO: patch-added-mqtt-monitor.sql is not patched
2022-12-07T15:15:08.302Z [DB] INFO: patch-added-mqtt-monitor.sql is patching
2022-12-07T15:15:08.315Z [DB] INFO: patch-added-mqtt-monitor.sql was patched successfully
2022-12-07T15:15:08.315Z [DB] INFO: patch-add-clickable-status-page-link.sql is not patched
2022-12-07T15:15:08.315Z [DB] INFO: patch-add-clickable-status-page-link.sql is patching
2022-12-07T15:15:08.318Z [DB] INFO: patch-add-clickable-status-page-link.sql was patched successfully
2022-12-07T15:15:08.318Z [DB] INFO: patch-add-sqlserver-monitor.sql is not patched
2022-12-07T15:15:08.318Z [DB] INFO: patch-add-sqlserver-monitor.sql is patching
2022-12-07T15:15:08.322Z [DB] INFO: patch-add-sqlserver-monitor.sql was patched successfully
2022-12-07T15:15:08.322Z [DB] INFO: patch-add-other-auth.sql is not patched
2022-12-07T15:15:08.322Z [DB] INFO: patch-add-other-auth.sql need parents
2022-12-07T15:15:08.322Z [DB] INFO: patch-add-other-auth.sql is patching
2022-12-07T15:15:08.338Z [DB] INFO: patch-add-other-auth.sql was patched successfully
2022-12-07T15:15:08.338Z [DB] INFO: patch-add-radius-monitor.sql is not patched
2022-12-07T15:15:08.338Z [DB] INFO: patch-add-radius-monitor.sql is patching
2022-12-07T15:15:08.350Z [DB] INFO: patch-add-radius-monitor.sql was patched successfully
2022-12-07T15:15:08.350Z [DB] INFO: patch-monitor-add-resend-interval.sql is not patched
2022-12-07T15:15:08.350Z [DB] INFO: patch-monitor-add-resend-interval.sql is patching
2022-12-07T15:15:08.353Z [DB] INFO: patch-monitor-add-resend-interval.sql was patched successfully
2022-12-07T15:15:08.353Z [DB] INFO: Database Patched Successfully
2022-12-07T15:15:08.358Z [SERVER] INFO: JWT secret is not found, generate one.
2022-12-07T15:15:08.442Z [SERVER] INFO: Stored JWT secret into database
2022-12-07T15:15:08.443Z [SERVER] INFO: No user, need setup
2022-12-07T15:15:08.444Z [SERVER] INFO: Adding route
2022-12-07T15:15:08.473Z [SERVER] INFO: Adding socket handler
2022-12-07T15:15:08.473Z [SERVER] INFO: Init the server
2022-12-07T15:15:08.478Z [SERVER] INFO: Listening on 3001

五、访问uptime-kuma服务

1.创建账号

image.png

2.访问uptime-kuma首页

image.png

六、添加监控项

1.添加监控项

image.png

2.查看监控项状态

image.png

相关文章
|
弹性计算 Devops Shell
用阿里云 DevOps Flow 实现 ECS 部署自动化:从准备到落地的完整指南
阿里云 DevOps Flow 是一款助力开发者实现自动化部署的高效工具,支持代码流水线构建、测试与部署至ECS实例,显著提升交付效率与稳定性。本文详解如何通过 Flow 自动部署 Bash 脚本至 ECS,涵盖环境准备、流水线搭建、源码接入、部署流程设计及结果验证,助你快速上手云上自动化运维。
1167 0
|
5天前
|
监控 安全 Linux
裸机云服务器完全操作指南:从零开始部署与高效管理
裸机云服务器兼具物理服务器的强悍性能与云服务器的灵活便捷,是高性能计算、核心数据库等场景的理想选择。本文提供一份从购买到上线的详尽裸机云服务器操作指南,帮助您快速上手,高效管理您的专属物理服务器。
|
Java Linux Apache
在CentOS服务器上编译并部署NiFi源码
部署Apache NiFi在CentOS上是一个涉及细节的过程,需要注意Java环境、源码编译、配置调整等多个方面。遵循上述步骤,可以在CentOS服务器上成功部署和配置Apache NiFi,从而高效地处理和分发数据。
415 17
|
弹性计算 人工智能 前端开发
在阿里云ECS上部署n8n自动化工作流:U2实例实战
本文介绍如何在阿里云ECS的u2i/u2a实例上部署开源工作流自动化平台n8n,利用Docker快速搭建并配置定时任务,实现如每日抓取MuleRun新AI Agent并推送通知等自动化流程。内容涵盖环境准备、安全组设置、实战案例与优化建议,助力高效构建低维护成本的自动化系统。
2658 5
|
弹性计算 安全 Linux
使用阿里云服务器安装Z-Blog博客网站流程,新手一键部署教程
本教程教你如何在阿里云99元服务器上,通过宝塔Linux面板一键部署Z-Blog博客。基于CentOS 7.9系统,从远程连接、安装宝塔面板、开放端口到部署Z-Blog全流程详解,操作简单,新手也能轻松搭建个人博客网站。
1425 13
|
运维 Dubbo Cloud Native
Dubbo 云原生重构出击:更快部署、更强控制台、更智能运维
Apache Dubbo 最新升级支持云原生,提供一键部署微服务集群与全新可视化控制台,提升全生命周期管理体验,助力企业高效构建云原生应用。
2018 25
|
监控 Java Linux
Apache NiFi项目的编译与部署于CentOS服务器
总而言之,Apache NiFi的编译和部署虽然涉及多个步骤,但这些操作步骤简明扼要,即使是不太熟悉Java或Maven的用户也能跟随指南完成。通过遵循上述步骤,您将能够在CentOS服务器上成功部署Apache NiFi,为您的数据流处理任务建立一个功能强大的平台。
679 16
|
资源调度 负载均衡 JavaScript
使用PM2工具部署Vue.js应用于服务器
以上步骤完成之后,你就成功利⽤ PM⼆工具将 Vuejs 应⽰程序部署至服 务 器,并且配合反向代理实现了高效稳定访问及负载均衡功能。
694 0

热门文章

最新文章