Node Redis:not able to persist on disk

在服务器上为http://mqtt.phodal.com部署Node Redis的时候发现一会就挂 了,报了下面的错误:

node_redis: no callback to send error: Error: MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error.

/home/www/diaonan/node_modules/redis/index.js:511
        throw err;
              ^
Error: Error: MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error.

后面一查看到是没有配置redis数据库文件的路径

打开

redis-cli

输入

127.0.0.1:6379> CONFIG SET dir /tmp/var/dredis
OK
127.0.0.1:6379> CONFIG SET dbfilename temp.rdb
OK
127.0.0.1:6379>exit

接着我们就可以继续使用

Node root does not have permission

接着又报了个钷

 Warning "root" does not have permission to access the dev dir

需要添加参数--unsafe-perm

sudo npm install --unsafe-perm

关于我

Github: @phodal     微博:@phodal     知乎:@phodal    

微信公众号(Phodal)

围观我的Github Idea墙, 也许,你会遇到心仪的项目

QQ技术交流群: 321689806