Centos7 Jenkins日志过大

Posted wnpursue

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Centos7 Jenkins日志过大相关的知识,希望对你有一定的参考价值。

df 查看 占用

[[email protected] /]# df
Filesystem     1K-blocks     Used Available Use% Mounted on
devtmpfs         1008756        0   1008756   0% /dev
tmpfs            1020532        0   1020532   0% /dev/shm
tmpfs            1020532    17048   1003484   2% /run
tmpfs            1020532        0   1020532   0% /sys/fs/cgroup
/dev/vda1       41152716 23703492  15702820  61% /
overlay         41152716 23703492  15702820  61% /var/lib/docker/overlay2/c9b8caf06e0ad30a31f6c07f9613fdedab8a421062ece6742c0b2be82c9fc8a4/merged
shm                65536        8     65528   1% /var/lib/docker/containers/4f10f72d7aeab949f61af6bd79567b33898482ffbbb6dd2df2a98d0177f3bc88/mounts/shm
overlay         41152716 23703492  15702820  61% /var/lib/docker/overlay2/4e9cf0a90f69dbe5d852fd8a11538ffc0eca2bcfc44b219a6c59d7a86d66bd2a/merged
shm                65536        0     65536   0% /var/lib/docker/containers/f3e20483118e8dc248a5c11b60974959e0049a02898c8e17b3fd38590cfb27eb/mounts/shm
overlay         41152716 23703492  15702820  61% /var/lib/docker/overlay2/e4ce1e7a67fdb15a01f49b4331edcdd5fbbfcd853903b82bf58bf4aafcbe2ffb/merged
shm                65536       64     65472   1% /var/lib/docker/containers/53914bcee1c41fbf162e079a5037955101dd8d0e5cc90e3d98fc50a15ad1aa7d/mounts/shm
tmpfs             204108        0    204108   0% /run/user/0
[[email protected] lib]# cd /
[[email protected] /]# sudo du -ah --max-depth=1 
4.2M    ./tmp
0   ./bin
3.5G    ./usr
0   ./sys
139M    ./root
0   ./sbin
0   ./lib
0   ./lib64
4.0K    ./home
150M    ./opt
du: cannot access ‘./proc/17755/task/17755/fd/4’: No such file or directory
du: cannot access ‘./proc/17755/task/17755/fdinfo/4’: No such file or directory
du: cannot access ‘./proc/17755/fd/3’: No such file or directory
du: cannot access ‘./proc/17755/fdinfo/3’: No such file or directory
0   ./proc
16K ./lost+found
4.0K    ./mnt
4.0K    ./srv
0   ./.autorelabel
226M    ./boot
39M ./etc
20G ./var
4.0K    ./flag_ok
4.0K    ./media
0   ./dev
17M ./run
24G .

继续 sudo du -ah --max-depth=1

[[email protected] /]# cd var 
[[email protected] var]# ls
account  adm  cache  crash  db  empty  games  gopher  kerberos  lib  local  lock  log  mail  nis  opt  preserve  run  spool  tmp  yp
[[email protected] var]# sudo du -ah --max-depth=1 
20K ./tmp
4.0K    ./crash
4.0K    ./.updated
203M    ./cache
0   ./lock
20K ./db
4.0K    ./nis
3.9G    ./lib
4.0K    ./local
0   ./mail
4.0K    ./opt
16G ./log
4.0K    ./games
4.0K    ./adm
120K    ./spool
4.0K    ./preserve
4.0K    ./account
12K ./kerberos
8.0K    ./empty
4.0K    ./gopher
4.0K    ./yp
0   ./run
20G .
[[email protected] var]# 

16G

[[email protected] log]# sudo du -ah --max-depth=1 
716K    ./messages
4.2M    ./sa
5.8M    ./audit
0   ./boot.log
32K ./boot.log-20190415
716K    ./btmp
28K ./yum.log
4.0K    ./qemu-ga
12K ./cloud-init-output.log
32K ./dmesg.old
4.0K    ./grubby_prune_debug
0   ./spooler
36K ./wtmp
280K    ./cloud-init.log
4.0K    ./grubby
16G ./jenkins
4.0K    ./anaconda
4.0K    ./maillog
1.1M    ./secure
4.0K    ./chrony
32K ./dmesg
4.0K    ./rhsm
16K ./tuned
12K ./lastlog
112K    ./cron
28K ./boot.log-20190417
16G .

技术图片

原因:
因为DNS查询错误,返回了所有的日志数据,解决方法:
【系统管理】=》【system log】=>【日志级别】=》【Name: javax.jmdns,Level: off】
技术图片

[[email protected] log]# cd jenkins 
[[email protected] jenkins]# ls
jenkins.log
[[email protected] jenkins]# sudo rm jenkins.log

以上是关于Centos7 Jenkins日志过大的主要内容,如果未能解决你的问题,请参考以下文章

centos7下,解决Apache错误日志文件过大问题

开发人员学Linux(11):CentOS7安装配置持续集成工具Jenkins

CentOS7 安装Jenkins

CentOS7 安装配置 jenkins 及 自动从gitlab上拉取代码自动打包并发布到远程tomcat服务器

centos7 安装jenkins

jenkins-系统管理-节点管理进去报错