我无法再在数据库中生成新列。我的筹码在下面。我是管理自己的服务器的新手,不熟悉Apache,Ubuntu和AWS。目前我收到一条错误消息,说我没有剩余空间。
看起来我的文件夹/ dev / xvda1的容量为100%。如何确定如何分配空间以及如何开辟更多空间?
如果您可以帮助我分享内容,我会热切地分享更多信息。
我的错误
irb(main):107:0> Survey.generate_for_appointment(a, b)
PG::DiskFull: ERROR: could not extend file "base/16402/25415": No space left on device
HINT: Check free disk space.
: INSERT INTO "questions" ("choices", "content", "created_at", "position", "question_type", "survey_group", "survey_group_question_id", "survey_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"
log writing failed. No space left on device @ io_write - /etc/projects/myapp/log/production.log
ActiveRecord::StatementInvalid: PG::DiskFull: ERROR: could not extend file "base/16402/25415": No space left on device
HINT: Check free disk space.
存储
ubuntu@ip-172-31-33-140:/etc/projects/myapp$ sudo du -h --max-depth=1 /
4.0K /media
752K /tmp
0 /sys
9.6M /bin
1.3G /home
908M /usr
4.0K /mnt
20M /boot
24K /root
4.0K /opt
3.7G /etc
du: cannot access ‘/proc/7489/task/7489/fd/4’: No such file or directory
du: cannot access ‘/proc/7489/task/7489/fdinfo/4’: No such file or directory
du: cannot access ‘/proc/7489/fd/4’: No such file or directory
du: cannot access ‘/proc/7489/fdinfo/4’: No such file or directory
0 /proc
9.4M /sbin
4.0K /srv
16K /lost+found
60M /lib
12K /dev
649M /var
4.0K /lib64
212K /run
7.5G /
ubuntu@ip-172-31-33-140:/etc/projects/myapp$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 7.8G 7.5G 0 100% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
udev 284M 12K 284M 1% /dev
tmpfs 59M 212K 59M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 295M 0 295M 0% /run/shm
none 100M 0 100M 0% /run/user
详细存储空间
ubuntu@ip-172-31-33-140:/etc/projects/myapp$ sudo du -x / | sort -n | tail -40
98880 /home/ubuntu/.rvm/rubies/ruby-2.1.2
98908 /home/ubuntu/.rvm/gems/ruby-2.1.2/gems/nokogiri-1.6.4.1
98908 /home/ubuntu/.rvm/rubies/ruby-2.1.5/lib
99436 /home/ubuntu/.rvm/rubies/ruby-2.1.5
107920 /home/ubuntu/.rvm/gems/ruby-2.1.2/gems/nokogiri-1.6.1/ext/nokogiri/tmp/x86_64-linux-gnu/ports
107924 /home/ubuntu/.rvm/gems/ruby-2.1.2/gems/nokogiri-1.6.1/ext/nokogiri/tmp/x86_64-linux-gnu
107928 /home/ubuntu/.rvm/gems/ruby-2.1.2/gems/nokogiri-1.6.1/ext/nokogiri/tmp
108520 /var/lib/apt/lists
108572 /var/lib/apt
111044 /usr/src
119420 /home/ubuntu/.rvm/gems/ruby-2.1.2/gems/nokogiri-1.6.1/ext/nokogiri
119424 /home/ubuntu/.rvm/gems/ruby-2.1.2/gems/nokogiri-1.6.1/ext
145780 /home/ubuntu/.rvm/gems/ruby-2.1.2/gems/nokogiri-1.6.1
146972 /var/cache
155528 /home/ubuntu/.rvm/gems/ruby-2.1.2/gems/passenger-4.0.45/buildout
155916 /usr/lib/x86_64-linux-gnu
158396 /etc/projects/myapp/public/assets
163068 /etc/projects/myapp/public
198320 /home/ubuntu/.rvm/rubies
200824 /home/ubuntu/.rvm/gems/ruby-2.1.2/gems/passenger-4.0.45
207540 /home/ubuntu/.rvm/gems/ruby-2.1.5/gems
231732 /var/lib
264856 /home/ubuntu/.rvm/gems/ruby-2.1.5
271292 /var/log/apache2
284432 /var/log
292684 /usr/share
403300 /usr/lib
583604 /home/ubuntu/.rvm/gems/ruby-2.1.2/gems
650888 /home/ubuntu/.rvm/gems/ruby-2.1.2
664560 /var
915752 /home/ubuntu/.rvm/gems
929616 /usr
1174228 /home/ubuntu/.rvm
1262052 /home/ubuntu
1262056 /home
3470180 /etc/projects/myapp/log
3782520 /etc/projects/myapp
3782524 /etc/projects
3789104 /etc
7795236 /
正在使用的节点
ubuntu@ip-172-31-33-140:/etc/projects/myapp$ df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/xvda1 524288 153278 371010 30% /
none 75346 2 75344 1% /sys/fs/cgroup
udev 72620 381 72239 1% /dev
tmpfs 75346 266 75080 1% /run
none 75346 3 75343 1% /run/lock
none 75346 1 75345 1% /run/shm
none 75346 2 75344 1% /run/user
Passanger版本
Phusion Passenger version 4.0.55
Apache版本
Server version: Apache/2.4.7 (Ubuntu)
RVM版本
rvm 1.26.4 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
Ruby版本
rvm rubies
ruby-2.1.2 [ x86_64 ]
=* ruby-2.1.5 [ x86_64 ]
# => - current
# =* - current && default
# * - default
答案 0 :(得分:2)
您只有7.5G的总空间。您的/ etc文件夹正在使用3.7G,这似乎太多了,您的主目录是1.3G。在每个目录上使用du -sh *
来查找在其中使用了如此多空间的内容,并在不再需要时删除它们。例如,〜/ Downloads文件夹中的项目,/ var / log中的旧日志,或其他任何东西都在/ etc中占用了太多空间。