云原生之使用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.创建账号
2.访问uptime-kuma首页
六、添加监控项
1.添加监控项
2.查看监控项状态
【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)