近段时间使用OpenShift 再次出现503错误,登陆ssh 也提示Disk quota exceeded,可能确实超出了资源配置,所以即使通过使用rhc app restart $appctl_all restart 来重启应用都无法解决问题,赶忙上OpenShift社区看看。 我那个应用全部都是静态页面,但我的Cartridges依然是使用了PHP,不知道会不会有负面影响。下面是出现503错误时使用quota输出的使用情况:

quota -s
quota: Cannot resolve mountpoint path /tmp (deleted): No such file or directory
quota: Cannot resolve mountpoint path /var/tmp (deleted): No such file or directory
Disk quotas for user 43be8375e7ef43009305a7683749fa32 (uid 4341):
Filesystem blocks quota limit grace files quota limit grace
/dev/mapper/EBSStore01-user_home01
100812 0 1024M 1280 0 40000

OpenShift, Inc 工作人员Nam Duong在社区上提到:

How can we see how much is left? I have scheduled a cron job to delete all log files > 3 days now, which leaves ~90MB of logs for 3 days. Would that be a problem? That shouldn’t be the problem. You can use rhc app tidy `instead。`

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

> When JBoss starts up, it will need to process the war file using temporary diskspace. If you application war file is large, temporary disk will be consumed proportionally to the size of your war file. In the case above, the user had a large war file which consumed a total of 700MB on startup thereby surpassing the 1GB diskspace limit before completely starting up.

([原文链接](https://openshift.redhat.com/community/kb/kb-e1063-jboss-app-fails-to-start-and-throws-javaioioexception-disk-quota-exceeded-but-quota-s)) 也就是说是用`rhc app tidy`整理清除应用的日志文件和临时目录即可,然后使用`rhc app force-stop $app`和`rhc app start $app`或者登陆ssh 使用`ctl_all restart`重启应用。 _小插`rhc help app` 输出的tidy帮助说明:Clean out the application's logs and tmp directories and tidy up the git repo on the server_ 执行

rhc app tidy $app

使用

quota -s

查看当前资源使用,输出如下:

quota: Cannot resolve mountpoint path /tmp (deleted): No such file or directory
quota: Cannot resolve mountpoint path /var/tmp (deleted): No such file or directory
Disk quotas for user 43be8375e7ef43009305a7683749fa32 (uid 4341):
Filesystem blocks quota limit grace files quota limit grace
/dev/mapper/EBSStore01-user_home01
162M 0 1024M 1280 0 40000

现在应用已经恢复正常,503错误已经消失了。``

Comments