云原生之使用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

相关文章
|
5天前
|
Ubuntu Linux 开发工具
docker 是什么?docker初认识之如何部署docker-优雅草后续将会把产品发布部署至docker容器中-因此会出相关系列文章-优雅草央千澈
Docker 是一个开源的容器化平台,允许开发者将应用程序及其依赖项打包成标准化单元(容器),确保在任何支持 Docker 的操作系统上一致运行。容器共享主机内核,提供轻量级、高效的执行环境。本文介绍如何在 Ubuntu 上安装 Docker,并通过简单步骤验证安装成功。后续文章将探讨使用 Docker 部署开源项目。优雅草央千澈 源、安装 Docker 包、验证安装 - 适用场景:开发、测试、生产环境 通过以上步骤,您可以在 Ubuntu 系统上成功安装并运行 Docker,为后续的应用部署打下基础。
docker 是什么?docker初认识之如何部署docker-优雅草后续将会把产品发布部署至docker容器中-因此会出相关系列文章-优雅草央千澈
|
1月前
|
Java 应用服务中间件 Docker
将基于 Spring 的 WAR 应用程序部署到 Docker:详尽指南
将基于 Spring 的 WAR 应用程序部署到 Docker:详尽指南
36 2
|
2月前
|
运维 Cloud Native 云计算
云原生之旅:Docker容器化实战
本文将带你走进云原生的世界,深入理解Docker技术如何改变应用部署与运维。我们将通过实际案例,展示如何利用Docker简化开发流程,提升应用的可移植性和伸缩性。文章不仅介绍基础概念,还提供操作指南和最佳实践,帮助你快速上手Docker,开启云原生的第一步。
|
2月前
|
Java Linux Docker
什么是 Docker?如何将 Spring Boot 应用程序部署到 Docker?
什么是 Docker?如何将 Spring Boot 应用程序部署到 Docker?
50 3
|
2月前
|
NoSQL 容灾 MongoDB
MongoDB主备副本集方案:两台服务器使用非对称部署的方式实现高可用与容灾备份
在资源受限的情况下,为了实现MongoDB的高可用性,本文探讨了两种在两台服务器上部署MongoDB的方案。方案一是通过主备身份轮换,即一台服务器作为主节点,另一台同时部署备节点和仲裁节点;方案二是利用`priority`设置实现自动主备切换。两者相比,方案二自动化程度更高,适合追求快速故障恢复的场景,而方案一则提供了更多的手动控制选项。文章最后对比了这两种方案与标准三节点副本集的优缺点,指出三节点方案在高可用性和数据一致性方面表现更佳。
|
2月前
|
运维 Kubernetes Cloud Native
云原生技术入门:Kubernetes和Docker的协同工作
【10月更文挑战第43天】在云计算时代,云原生技术成为推动现代软件部署和运行的关键力量。本篇文章将带你了解云原生的基本概念,重点探讨Kubernetes和Docker如何协同工作以支持容器化应用的生命周期管理。通过实际代码示例,我们将展示如何在Kubernetes集群中部署和管理Docker容器,从而为初学者提供一条清晰的学习路径。
|
2月前
|
机器学习/深度学习 数据采集 Docker
Docker容器化实战:构建并部署一个简单的Web应用
Docker容器化实战:构建并部署一个简单的Web应用
|
2月前
|
持续交付 开发者 Docker
掌握Docker容器化技术,加速软件开发与部署
掌握Docker容器化技术,加速软件开发与部署
58 0
|
30天前
|
运维 Cloud Native 持续交付
深入理解云原生架构及其在现代企业中的应用
随着数字化转型的浪潮席卷全球,企业正面临着前所未有的挑战与机遇。云计算技术的迅猛发展,特别是云原生架构的兴起,正在重塑企业的IT基础设施和软件开发模式。本文将深入探讨云原生的核心概念、关键技术以及如何在企业中实施云原生策略,以实现更高效的资源利用和更快的市场响应速度。通过分析云原生架构的优势和面临的挑战,我们将揭示它如何助力企业在激烈的市场竞争中保持领先地位。
|
28天前
|
Kubernetes Cloud Native 微服务
探索云原生技术:容器化与微服务架构的融合之旅
本文将带领读者深入了解云原生技术的核心概念,特别是容器化和微服务架构如何相辅相成,共同构建现代软件系统。我们将通过实际代码示例,探讨如何在云平台上部署和管理微服务,以及如何使用容器编排工具来自动化这一过程。文章旨在为开发者和技术决策者提供实用的指导,帮助他们在云原生时代中更好地设计、部署和维护应用。

热门文章

最新文章