ubuntu 上运行的django 出现No space left on device错误

原文连接:https://www.cnblogs.com/yasmi/p/5192694.html

 

 

运行django出现错误信息:

[2016-02-16 14:33:24,476 pyinotify ERROR] add_watch: cannot watch /usr/local/lib/python2.7/dist-packages/django/contrib/sessions/backends/cache.py WD=-1,Errno=No space left on device (ENOSPC) ERROR:pyinotify:add_watch: cannot watch /usr/local/lib/python2.7/dist-packages/django/contrib/sessions/backends/cache.py WD=-1,Errno=No space left on device (ENOSPC)

查询网络第一判断是缺少Inode节点: linux中创建一个文件不仅仅需要存储空间,也需要Inode节点。Inode节点在磁盘建立的时候就分配好最大的个数(每2K空间分配一个节点),一般情况下这个数目是够用的,但是如果磁盘拥有大量小文件(小于2k),就能将Inode节点用完。

查看存储空间

1

$df -h

查看i节点

1

$df -i

看是那种情况。

 

不幸的是我哪种都不是,后来在stackflow找到了答案。

问题原因:You may have reached your quota of watches.

解决办法

  查看目前的最大值

To find your current limit,type this in your terminal:

1

$cat /proc/sys/fs/inotify/max_user_watches

 

  增加最大值

Which is typically 8192 by default.

To increase your limit,type this:

1

$sudo sysctl fs.inotify.max_user_watches=16384

 

  永久设置最大值

Then restart django.

To permanently set this limit,type this:

1

$echo 16384 | sudo tee -a /proc/sys/fs/inotify/max_user_watches

相关文章

ubuntu退出redis的示例:指定配置文件方式启动源码redis:roo...
ubuntu中mysql改密码忘了的解决方法:1.在终端中切换到root权...
ubuntu安装mysql失败的解决方法原因:可能是原有的MySQL还有...
使用centos和ubuntu建站的区别有以下几点1.CentOS是Linux发行...
ubuntu图形界面和字符界面切换的方法:可以通过快捷键CTRL+A...
ubuntu中重启mysql失败的解决方法1.首先,在ubuntu命令行中,...