当' rhc tidy'以及如何在openshift上清理磁盘空间没有足够的磁盘空间?

时间:2014-08-04 20:44:41

标签: git openshift diskspace openshift-client-tools

我在openshift上的配额已超过:

 Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
 /dev/mapper/EBSStore01-user_home01
            1048572       0 1048576            6890       0   80000        

我发现了一个不同的stackoverflow问题,可以通过'rhc app-tidy'来清理磁盘空间

但是当我运行此命令时,我收到以下错误:

Warning: Gear xxx is using 100.0% of disk quota
Failed to execute: 'control start' for /var/lib/openshift/xxx/mysql

当我运行以下命令时,请确保查看哪些文件使用的空间最多

du -h * | sort -rh | head -50

我得到以下输出:

605M    wildfly
320M    git/mythings.git/objects
320M    git/mythings.git
320M    git
317M    wildfly/usr/lib/jvm/jdk1.8.0_05
317M    wildfly/usr/lib/jvm
317M    wildfly/usr/lib
317M    wildfly/usr
166M    wildfly/usr/lib/jvm/jdk1.8.0_05/jre
165M    wildfly/usr/lib/jvm/jdk1.8.0_05/jre/lib
136M    wildfly/versions/8
136M    wildfly/versions
118M    wildfly/versions/8/modules
118M    wildfly/usr/lib/jvm/jdk1.8.0_05/lib
118M    wildfly/modules
116M    wildfly/versions/8/modules/system/layers/base
116M    wildfly/versions/8/modules/system/layers
116M    wildfly/versions/8/modules/system
116M    wildfly/modules/system/layers/base
116M    wildfly/modules/system/layers
116M    wildfly/modules/system
95M wildfly/versions/8/modules/system/layers/base/org
95M wildfly/modules/system/layers/base/org
59M wildfly/usr/lib/jvm/jdk1.8.0_05/jre/lib/i386
52M mysql/data
52M mysql
49M wildfly/usr/lib/jvm/jdk1.8.0_05/lib/missioncontrol
43M wildfly/usr/lib/jvm/jdk1.8.0_05/lib/missioncontrol/plugins
37M wildfly/versions/8/modules/system/layers/base/org/jboss
37M wildfly/modules/system/layers/base/org/jboss
32M wildfly/usr/lib/jvm/jdk1.8.0_05/lib/visualvm
28M git/mythings.git/objects/76
26M wildfly/usr/lib/jvm/jdk1.8.0_05/jre/lib/ext
26M git/mythings.git/objects/pack
26M git/mythings.git/objects/f6
21M wildfly/usr/lib/jvm/jdk1.8.0_05/lib/visualvm/platform
21M app-root/runtime/repo
21M app-root/runtime
21M app-root
21M app-deployments/2014-08-04_14-34-47.614/repo
21M app-deployments/2014-08-04_14-34-47.614
21M app-deployments
20M wildfly/versions/8/modules/system/layers/base/org/jboss/as
20M wildfly/modules/system/layers/base/org/jboss/as
20M git/mythings.git/objects/ac
20M git/mythings.git/objects/8a
20M git/mythings.git/objects/6e
20M git/mythings.git/objects/69
20M git/mythings.git/objects/21
20M git/mythings.git/objects/12

正如你所看到的那样,git目录占用了大量空间,但是当我尝试'git gc'时,我收到以下错误:

Counting objects: 226, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (192/192), done.
dm-0: write failed, user block limit reached.
fatal: sha1 file '/var/lib/openshift/xxx/git/mythings.git/objects/pack/tmp_pack_ipHspL' write error: Disk quota exceeded
error: failed to run repack

所以现在我没有想法,我该怎样做才能清理一些空间?

谢谢!

3 个答案:

答案 0 :(得分:1)

删除您可以从备份或包中轻松恢复的内容,例如JDK。这应该给你足够的空间来进行清理。 然后恢复你删除的内容。

或支付更多存储费用。 : - )

答案 1 :(得分:1)

如上所述,您需要 ssh到您的磁带(您将在Web控制台中找到代码 - 在删除按钮旁边),然后 cd到app-root / logs 然后运行du -sh来检查当前目录的维度,在我的例子中,文件 php-error.log 542M 。您可以使用 rm -f php-error.log

安全删除它

答案 2 :(得分:0)

ssh然后使用ssh clients (i use putty)command prompt到应用程序目录 尝试找出不必要的文件并删除它们。

在我的情况下,删除app-log文件夹的内容就像魅力一样。

关注临时文件夹和日志文件夹