運行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節點用完。
查看存儲空間
$df -h
查看i節點
$df -i
看是那種情況。
不幸的是我哪種都不是,后來在stackflow找到了答案。
問題原因:You may have reached your quota of watches.
解決辦法
查看目前的最大值
To find your current limit, type this in your terminal:
$cat /proc/sys/fs/inotify/max_user_watches
增加最大值
Which is typically 8192 by default.
To increase your limit, type this:
$sudo sysctl fs.inotify.max_user_watches=16384
永久設置最大值
Then restart django.
To permanently set this limit, type this:
$echo 16384 | sudo tee -a /proc/sys/fs/inotify/max_user_watches