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

江湖有缘
• 阅读 304

一、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 kuma --restart=always -p 3001:3001 -v /data/kuma/data:/app/data -v /var/run/docker.sock:/var/run/docker.sock  louislam/uptime-kuma:1
09a9c130381326f7b41681fd59e0f6376247a1130fb33aff73505014b86b1c4b


3.查看uptime-kuma容器状态

[root@jeven kuma]# docker ps
CONTAINER ID   IMAGE                                   COMMAND                  CREATED         STATUS                            PORTS                                                                                                                 NAMES
09a9c1303813   louislam/uptime-kuma:1                  "/usr/bin/dumb-init …"   8 seconds ago   Up 7 seconds (health: starting)   0.0.0.0:3001->3001/tcp, :::3001->3001/tcp                                                                             kuma

4.查看uptime-kuma容器日志

[root@jeven kuma]# docker logs 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:27:35.692Z [SERVER] INFO: Welcome to Uptime Kuma
2022-12-07T15:27:35.692Z [SERVER] INFO: Node Env: production
2022-12-07T15:27:35.692Z [SERVER] INFO: Importing Node libraries
2022-12-07T15:27:35.693Z [SERVER] INFO: Importing 3rd-party libraries
2022-12-07T15:27:36.114Z [SERVER] INFO: Creating express and socket.io instance
2022-12-07T15:27:36.115Z [SERVER] INFO: Server Type: HTTP
2022-12-07T15:27:36.116Z [SERVER] INFO: Importing this project modules
2022-12-07T15:27:36.161Z [NOTIFICATION] INFO: Prepare Notification Providers
2022-12-07T15:27:36.202Z [SERVER] INFO: Version: 1.18.5
2022-12-07T15:27:36.289Z [DB] INFO: Data Dir: ./data/
2022-12-07T15:27:36.289Z [SERVER] INFO: Connecting to the Database
2022-12-07T15:27:36.423Z [DB] INFO: SQLite config:
[ { journal_mode: 'wal' } ]
[ { cache_size: -12000 } ]
2022-12-07T15:27:36.430Z [DB] INFO: SQLite Version: 3.38.3
2022-12-07T15:27:36.431Z [SERVER] INFO: Connected
2022-12-07T15:27:36.432Z [DB] INFO: Your database version: 10
2022-12-07T15:27:36.432Z [DB] INFO: Latest database version: 10
2022-12-07T15:27:36.432Z [DB] INFO: Database patch not needed
2022-12-07T15:27:36.433Z [DB] INFO: Database Patch 2.0 Process
2022-12-07T15:27:36.446Z [SERVER] INFO: Load JWT secret from database.
2022-12-07T15:27:36.448Z [SERVER] INFO: Adding route
2022-12-07T15:27:36.519Z [SERVER] INFO: Adding socket handler
2022-12-07T15:27:36.519Z [SERVER] INFO: Init the server
2022-12-07T15:27:36.536Z [SERVER] INFO: Listening on 3001
2022-12-07T15:27:36.811Z [AUTH] INFO: Login by token. IP=192.168.3.11
2022-12-07T15:27:36.814Z [AUTH] INFO: Username from JWT: admin
2022-12-07T15:27:36.817Z [AUTH] INFO: Successfully logged in user admin. IP=192.168.3.11
2022-12-07T15:27:37.386Z [MONITOR] WARN: Monitor #2 'docker-status': Failing: Cannot read properties of null (reading '_dockerType') | Interval: 60 seconds | Type: docker | Down Count: 0 | Resend Interval: 0
2022-12-07T15:27:47.833Z [AUTH] INFO: Login by token. IP=192.168.3.11
2022-12-07T15:27:47.833Z [AUTH] INFO: Username from JWT: admin
2022-12-07T15:27:47.835Z [AUTH] INFO: Successfully logged in user admin. IP=192.168.3.11
2022-12-07T15:27:52.058Z [MONITOR] INFO: Get Monitor: 2 User ID: 1
2022-12-07T15:28:09.550Z [MANAGE] INFO: Resume Monitor: 2 User ID: 1
2022-12-07T15:28:09.554Z [MONITOR] WARN: Monitor #2 'docker-status': Failing: Cannot read properties of null (reading '_dockerType') | Interval: 60 seconds | Type: docker | Down Count: 0 | Resend Interval: 0
2022-12-07T15:28:09.564Z [MONITOR] INFO: Get Monitor: 2 User ID: 1
2022-12-07T15:28:37.619Z [MONITOR] INFO: Get Monitor: 2 User ID: 1
2022-12-07T15:28:56.543Z [MANAGE] INFO: Resume Monitor: 2 User ID: 1
2022-12-07T15:28:56.567Z [MONITOR] INFO: Get Monitor: 2 User ID: 1


五、访问uptime-kuma服务

1.创建账号

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

2.访问uptime-kuma首页

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

六、添加http监控项

1.添加http监控项

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

2.查看监控项状态

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

七、添加docker监控项

1.配置docker宿主信息

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

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

2.添加docker监控项

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

3.查看监控项状态

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

点赞
收藏
评论区
推荐文章
玩转服务器之Docker篇:10分钟学会搭建 Docker 环境
数字化转型浪潮下,云原生技术领域的建设投入、集群规模持续走高,云原生技术已是大势所趋。在用户生产环境中,容器技术的采纳率已接近70%,docker使应用部署更加轻量,可移植,可扩展,更好的环境隔离也更大程度地避免了生产环境与测试环境不一致的巨大尴尬,本文为大家详细讲解如何手动搭建Docker环境。
Wesley13 Wesley13
3年前
4.Grafana展示监控数据
Grafana是什么?我们知道Node\_export监控服务器状态,但是没有具体的展示,简单来说,Grafana的主要作用就是对监控的数据进行图形化展示。docker部署grafana我们这里采用docker方式部署,Docker安装,可参考Centos7下实现dockerwordpress安装(https://
Wesley13 Wesley13
3年前
2019 年 CNCF 中国云原生调查报告
!头图.jpg(https://ucc.alicdn.com/pic/developerecology/6db0c465111b4d9a96eb1ffe85c00e7a.jpg)中国72%的受访者生产中使用Kubernetes在CNCF,为更好地了解开源和云原生技术的使用,我们定期调查社区。这是第三次中国云原生调查,以中文进行
Wesley13 Wesley13
3年前
1. 容器化部署一套云服务 第一讲 Jenkins(Docker + Jenkins + Yii2 + 云服务器))
容器化部署一套云服务系列1\.容器化部署一套云服务之Jenkins(https://www.oschina.net/action/GoToLink?urlhttps%3A%2F%2Fwww.cnblogs.com%2Fjackson0714%2Fp%2Fdeploy1.html)一、购买服务器服务器!caeef00
Stella981 Stella981
3年前
Docker 监控
如今,越来越多的公司开始使用Docker了,2/3的公司在尝试了Docker后最终使用了它。为了能够更精确的分配每个容器能使用的资源,我们想要实时获取容器运行时使用资源的情况,怎样对Docker上的应用进行监控呢?Docker的结构会不会加大监控难度?可是在没有专业运维团队来监控Docker的情况下,并且还想加快Dock
使用“宝塔一键迁移”工具,将单机版typecho博客系统迁移到京东云cvm云主机
服务器更换、网站搬家,对于很多开发者新手来说不是一件容易的事情,需要迁移网站程序、数据库,修改数据库连接文件等。在云迁移方案中,宝塔是非常简单好用的服务器运维面板,能够极大提升运维管理效率。本文将介绍如何使用“宝塔一键迁移”工具将单机版typecho博客系统快速迁移到京东云cvm云主机。
构建一体化云原生安全防御体系,京东云云原生安全平台重磅发布
当用户充分利用原生云能力进行应用设计、部署和运维时,云原生也面临新的安全挑战,例如镜像漏洞与投毒、编排软件漏洞、不安全配置利用、容器逃逸等。面对这样的风险,京东云重磅发布云原生安全平台,包含资产清点、镜像安全、运行时安全、网络安全、集群安全、节点安全等安全
江湖有缘 江湖有缘
1年前
【云原生之Docker实战】使用Docker部署ShowDoc文档工具
【云原生之Docker实战】使用Docker部署ShowDoc文档工具
邢德全 邢德全
4个月前
云端部署mes/万界星空科技云mes系统
万界星空科技MES制造执行系统,应用云上托管,提供云上自动部署和运维能力,解决手工部署效率低、错误率高、升级困难、业务中断、监控定位难等应用运维问题,适用于政企IT系统及互联网类应用。
江湖有缘 江湖有缘
1个月前
云原生之使用Docker部署RSS阅读器Huntly
云原生之使用Docker部署RSS阅读器Huntly
江湖有缘
江湖有缘
Lv1
各大IT社区专家博主,华为HCIE云计算认证等,路漫漫其修远兮,吾将上下而求索!
文章
12
粉丝
1
获赞
3