0
votes

I'm using Centos 6.9. I have installed Redis using yum:

sudo yum update

sudo yum install redis

No errors were given during the installation.

I can start Redis using redis-cli. It gives me the prompt as expected:

127.0.0.1:6379>

However whenever I issue commands (e.g. PING or SET foo bar) it's giving the following error message:

(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.

I've found MISCONF Redis is configured to save RDB snapshots. and gone through it but none of the advice in there works.

The Accepted Answer on the above was to use CONFIG SET to change the directory where Redis was storing data. I tried this in a non-root directory, CONFIG SET dir /home/andy, but it still gives me the same error message.

If I execute BGSAVE it says "Background saving started" but then attempting SET foo bar goes back to giving me the error above.

Other answers have discussed this being a permissions issue. However I don't see how these apply because I've tried starting Redis as both root and my own account (andy) and the same occurs.

I'm not sure if it's the same problem as described on the link or something else.

How can I further diagnose this? I am a PHP developer by trade so this is not my area of expertise, however I am trying to install Redis so I can use it with a PHP application which has it's own interface to Redis.

3

3 Answers

1
votes

It seems that the yum installation creates a redis user, and your Redis instance is running by this user. So even if you set dir to /home/andy, this redis user still doesn't have permission to write to andy's home directory.

Use ps aux |grep redis to get the user who's running redis, and config dir to a directory that this user has write permission.

0
votes

Quick fix for this error is, goto redis-cli and set following

127.0.0.1:6379> config set stop-writes-on-bgsave-error no

Above like just ignore it

-1
votes

I solved the problem by executing following commands:

$ redis-cli
> config set stop-writes-on-bgsave-error no