首页 > 其他分享 >云原生之使用docker部署uptime-kuma服务器监控面板

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

时间:2023-02-10 14:02:49浏览次数:59  
标签:uptime 12 container 2022 07T15 kuma docker port

(云原生之使用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 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.创建账号

image.png

2.访问uptime-kuma首页

image.png

六、添加http监控项

1.添加http监控项

image.png

2.查看监控项状态

image.png

七、添加docker监控项

1.配置docker宿主信息

在这里插入图片描述

在这里插入图片描述

2.添加docker监控项

在这里插入图片描述

3.查看监控项状态

在这里插入图片描述

标签:uptime,12,container,2022,07T15,kuma,docker,port
From: https://blog.51cto.com/u_14664141/6049204

相关文章

  • Docker安装使用Kafka
    通过Docker拉取镜像的方式进行安装照例先去DockerHub找一下镜像源,看下官方提供的基本操作(大部分时候官方教程比网上的要清晰一些,并且大部分教程可能也是翻译的官方的操作......
  • docker安装与命令
    转自:https://blog.csdn.net/qq_60750453/article/details/128312453守护进程重启:systemctldaemon-reload重启Docker服务:systemctlrestartdocker/servicedockerre......
  • Dockerfile构建镜像
    一、构建Apache镜像cd/opt/#建立工作目录mkdir/opt/apachecdapache/vimDockerfile#基于的基础镜像FROMcentos:7#维护镜像的用户信息MAINTAINERthisisa......
  • Docker-compose
    一、Docker-compose简介Docker-Compose项目是Docker官方的开源项目,负责实现对Docker容器集群的快速编排。Docker-Compose将所管理的容器分为三层,分别是工程(project),服务......
  • Docker搭建LNMP+wordpress
    一、项目模拟1.项目环境公司在实际的生产环境中,需要使用Docker技术在一台主机上创建LNMP服务并运行Wordpress网站平台。然后对此服务进行相关的性能调优和管理工......
  • docker容器磁盘空间查看命令和清理删除没有使用容器的命令和方法
    【问题描述】在服务器上面启动MQTT服务的时候,一直失败,之前是可以正常启动成功的。  【原因描述】开始以为是服务本地的问题或者是依赖包的问题,但是该安装包并没有......
  • 基于Linux的DockerFile添加中文字体
    FROMopenjdk:8u332-oraclelinux7#RUNsed-i's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g'/etc/apk/repositories#RUNapkadd--updatefont-adobe-100dpittf......
  • Docker学习笔记:查看当前用户和密码
    一、查看查看所有docker服务器登陆的用户和密码。Linuxcat/root/.docker/config.jsonWindowsC:\Users\Name.docker\config.json二、密码解码在config.json配置......
  • docker搭建vue+nginx部署
    Vue+nginx部署1.首先安装ningx镜像 2.将nginx关键目录映射到本机  首先在本机创建nginx的文件存储目录       www:nginx存储网站网页的目录......
  • docker搭建django+mysql
    1.本机项目迁移到linux系统中2.编写dockerfile内容如下 WOEKDIR 在容器中创建该目录COPY 复制本机当前目录下的requirements.txt文件 到容器drfproject......