NutzCN Logo
问答 线上项目遇到磁盘沾满导致项目奔溃无法服务
发布于 2618天前 作者 qq_abeb45de 3119 次浏览 复制 上一个帖子 下一个帖子
标签: linux

查看了tomcat下的文件 没有大文件;只有 /pro这个项目占的磁盘越来越大导致爆满 但是又无法查/pro项目中每个文件的具体大小; 不明白到底是程序代码的问题还是什么原因导致的;希望懂的大牛可以指点一下 非常感谢;本人QQ 185776493 非常感谢

13 回复
cd /
df -d 2

执行上面的命令, 贴输出

$ cd /
$ df -d 2
df: unknown option -- d
Try 'df --help' for more information.

看来系统版本挺老的

改成

du --max-depth=2

Linux version 3.10.0-693.el7.x86_64 (mockbuild@x86-038.build.eng.bos.redhat.com) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) ) #1 SMP Thu Jul 6 19:56:57 EDT 2017

[root@aws02 /]# du --max-depth=2
0 ./dev/dri
0 ./dev/vfio
0 ./dev/snd
0 ./dev/hugepages
0 ./dev/mqueue
0 ./dev/disk
0 ./dev/block
0 ./dev/char
0 ./dev/mapper
0 ./dev/net
0 ./dev/pts
0 ./dev/shm
0 ./dev/input
0 ./dev/raw
0 ./dev/xen
0 ./dev/cpu
0 ./dev
0 ./proc/fs
0 ./proc/bus
0 ./proc/irq
0 ./proc/sys
0 ./proc/tty
0 ./proc/xen
0 ./proc/acpi
0 ./proc/scsi
0 ./proc/driver
0 ./proc/sysvipc
0 ./proc/1
0 ./proc/2
0 ./proc/3
0 ./proc/5
0 ./proc/7
0 ./proc/8
0 ./proc/9
0 ./proc/10
0 ./proc/11
0 ./proc/12
0 ./proc/13
0 ./proc/15
0 ./proc/17
0 ./proc/18
0 ./proc/19
0 ./proc/20
0 ./proc/22
0 ./proc/23
0 ./proc/24
0 ./proc/25
0 ./proc/26
0 ./proc/27
0 ./proc/33
0 ./proc/34
0 ./proc/35
0 ./proc/36
0 ./proc/44
0 ./proc/46
0 ./proc/47
0 ./proc/48
0 ./proc/67
0 ./proc/119
0 ./proc/232
0 ./proc/233
0 ./proc/234
0 ./proc/235
0 ./proc/236
0 ./proc/240
0 ./proc/253
0 ./proc/254
0 ./proc/255
0 ./proc/256
0 ./proc/257
0 ./proc/258
0 ./proc/259
0 ./proc/260
0 ./proc/261
0 ./proc/262
0 ./proc/263
0 ./proc/330
0 ./proc/367
0 ./proc/399
0 ./proc/486
0 ./proc/488
0 ./proc/529
0 ./proc/530
0 ./proc/532
0 ./proc/534
0 ./proc/537
0 ./proc/538
0 ./proc/540
0 ./proc/582
0 ./proc/591
0 ./proc/792
0 ./proc/1059
0 ./proc/1061
0 ./proc/1147
0 ./proc/1148
0 ./proc/1150
0 ./proc/1291
0 ./proc/1637
0 ./proc/10455
0 ./proc/10517
du: cannot access ‘./proc/11139/task/11159/fdinfo/159’: No such file or directory
du: cannot access ‘./proc/11139/task/11452/fdinfo/159’: No such file or directory
du: cannot access ‘./proc/11139/task/11473/fd/159’: No such file or directory
du: cannot access ‘./proc/11139/task/11577/fd/159’: No such file or directory
du: cannot access ‘./proc/11139/task/11595/fdinfo/175’: No such file or directory
0 ./proc/11139
0 ./proc/11236
0 ./proc/11237
0 ./proc/11319
0 ./proc/25318
0 ./proc/25344
0 ./proc/25884
0 ./proc/27074
0 ./proc/27650
0 ./proc/27940
0 ./proc/27944
0 ./proc/27947
0 ./proc/28338
0 ./proc/28341
0 ./proc/28491
du: cannot access ‘./proc/28608/task/28608/fd/4’: No such file or directory
du: cannot access ‘./proc/28608/task/28608/fdinfo/4’: No such file or directory
du: cannot access ‘./proc/28608/fd/4’: No such file or directory
du: cannot access ‘./proc/28608/fdinfo/4’: No such file or directory
0 ./proc/28608
0 ./proc
4 ./run/NetworkManager
0 ./run/chrony
0 ./run/dbus
8 ./run/blkid
4 ./run/tuned
0 ./run/setrans
0 ./run/console
4 ./run/cloud-init
0 ./run/faillock
0 ./run/rhsm
0 ./run/netreport
0 ./run/user
0 ./run/sudo
0 ./run/sepermit
4 ./run/tmpfiles.d
124 ./run/udev
0 ./run/mount
16384 ./run/log
0 ./run/lock
4 ./run/initramfs
196 ./run/systemd
16772 ./run
0 ./sys/fs
0 ./sys/bus
0 ./sys/dev
0 ./sys/devices
0 ./sys/block
0 ./sys/class
0 ./sys/power
0 ./sys/firmware
0 ./sys/kernel
0 ./sys/module
0 ./sys/hypervisor
0 ./sys
72 ./etc/grub.d
1388 ./etc/pki
16 ./etc/rpm
22280 ./etc/selinux
4 ./etc/depmod.d
604 ./etc/ssh
4 ./etc/dracut.conf.d
4 ./etc/modprobe.d
0 ./etc/binfmt.d
4 ./etc/modules-load.d
32 ./etc/systemd
0 ./etc/sysctl.d
8 ./etc/rsyslog.d
60 ./etc/profile.d
0 ./etc/tmpfiles.d
7312 ./etc/udev
20 ./etc/NetworkManager
4 ./etc/X11
96 ./etc/bash_completion.d
0 ./etc/opt
0 ./etc/pm
12 ./etc/skel
348 ./etc/sysconfig
0 ./etc/xdg
0 ./etc/xinetd.d
0 ./etc/terminfo
12 ./etc/prelink.conf.d
12 ./etc/default
8 ./etc/ld.so.conf.d
4 ./etc/rwtab.d
8 ./etc/polkit-1
8 ./etc/firewalld
0 ./etc/popt.d
0 ./etc/alternatives
0 ./etc/chkconfig.d
56 ./etc/rc.d
28 ./etc/ppp
0 ./etc/cron.monthly
0 ./etc/statetab.d
4 ./etc/cron.hourly
0 ./etc/cron.weekly
0 ./etc/gcrypt
8 ./etc/libnl
0 ./etc/pkcs11
4 ./etc/sasl2
8 ./etc/groff
32 ./etc/iproute2
0 ./etc/ssl
16 ./etc/rhsm
0 ./etc/gss
0 ./etc/krb5.conf.d
4 ./etc/python
72 ./etc/security
108 ./etc/pam.d
4 ./etc/cron.d
4 ./etc/my.cnf.d
68 ./etc/openldap
108 ./etc/dbus-1
0 ./etc/gnupg
8 ./etc/dhcp
28 ./etc/logrotate.d
36 ./etc/yum
36 ./etc/yum.repos.d
12 ./etc/cron.daily
4 ./etc/wpa_supplicant
68 ./etc/cloud
12 ./etc/audisp
16 ./etc/audit
148 ./etc/postfix
12 ./etc/tuned
4 ./etc/qemu-ga
4 ./etc/kernel
4 ./etc/sudoers.d
40 ./etc/nginx
34312 ./etc
4 ./root/.ssh
0 ./root/.pki
4 ./root/.oracle_jre_usage
0 ./root/.java
4 ./root/.aws
12968 ./root/.npm
12 ./root/.forever
13036 ./root
16 ./var/tmp
48456 ./var/lib
4619908 ./var/log
0 ./var/adm
289428 ./var/cache
8 ./var/db
0 ./var/empty
0 ./var/games
0 ./var/gopher
0 ./var/local
0 ./var/nis
0 ./var/opt
0 ./var/preserve
16 ./var/spool
0 ./var/yp
0 ./var/kerberos
0 ./var/crash
4957836 ./var
0 ./tmp/.XIM-unix
0 ./tmp/.Test-unix
0 ./tmp/.X11-unix
0 ./tmp/.ICE-unix
0 ./tmp/.font-unix
0 ./tmp/systemd-private-c206a14b516f428cae025b917780d0b7-chronyd.service-KvzzXf
64 ./tmp/hsperfdata_root
4 ./tmp/npm-11794-afed63d9
4 ./tmp/npm-21885-0ad2ceff
72 ./tmp
79612 ./usr/bin
39036 ./usr/sbin
256352 ./usr/lib
157552 ./usr/lib64
257968 ./usr/share
0 ./usr/etc
0 ./usr/games
36 ./usr/include
19920 ./usr/libexec
47849536 ./usr/local
0 ./usr/src
48660012 ./usr
0 ./boot/efi
8096 ./boot/grub2
4 ./boot/grub
126912 ./boot
305576 ./home/ec2-user
305576 ./home
0 ./media
0 ./mnt
0 ./opt
0 ./srv
60004 ./data/yiba_manage
109988 ./data
136 ./proxy-advertisement/.git
28 ./proxy-advertisement/models
11172 ./proxy-advertisement/node_modules
4 ./proxy-advertisement/logs
11360 ./proxy-advertisement
54235876

贴的时候用 "插入代码" 按钮!!

47849536 ./usr/local

看来是 /usr/local 目录, 那就继续执行

cd /usr/local
du --max-depth=2
 du --max-depth=2
0       ./bin
0       ./etc
0       ./games
0       ./include
0       ./lib
0       ./lib64
0       ./libexec
0       ./sbin
0       ./share/applications
0       ./share/info
0       ./share/man
0       ./share
371104  ./src/jdk1.8
14920   ./src/apache-tomcat-7.0.78
47242356        ./src/tomcat7
328492  ./src/tomcat-sdkManage
47956872        ./src
47956872        

继续深入

cd /usr/local/src/tomcat7
du --max-depth=2 -h

谢谢你

du --max-depth=2 -h
804K    ./bin
0       ./conf/Catalina
204K    ./conf
6.9M    ./lib
1.7G    ./logs
44G     ./temp
132M    ./webapps/ROOT
116K    ./webapps/951159753357
30M     ./webapps/newsdk
188M    ./webapps
0       ./work/Catalina
0       ./work
46G     .

temp目录下面有东西

cd /usr/local/src/tomcat7/temp/
du --max-depth=2 -h

我好像发现的新大陆了 非常感谢你 可以加个朋友嘛 大牛真心的感谢

添加回复
请先登陆
回到顶部