Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot change Redis data dir even after changing the user

I am running redis 3.0.6 in ubuntu 16.04 server. I have edited the /etc/redis/redis.conf file & changed the dir option from /var/lib/redis to /home/redisdata & changed the owner of /home/redisdata to redis.

I have moved the dump.rdb from /var/lib/redis to /home/redisdata & tried to start the redis-server. But it keeps on saying :

Can't chdir to '/home/redisdata': Permission denied

Any help is appreciated!

Thanks.

like image 764
Anoop Ar Avatar asked Sep 20 '16 13:09

Anoop Ar


People also ask

How do I change redis config file?

You can alter the Redis configuration file directly by opening and editing it with your preferred text editor. For example, you can use nano to do so: sudo nano /etc/redis/redis. conf.

Where is redis config file located?

The Redis configuration file is located at installdir/redis/etc/redis. conf.

How do I view redis config?

You can obtain a list of all the supported configuration parameters by typing CONFIG GET * in an open redis-cli prompt. All the supported parameters have the same meaning of the equivalent configuration parameter used in the redis.

What is bind in redis?

It binds the redis instance to specific interface (and hence specific ip address). Basically your redis server will only listen to connections made to the address specified in via the bind option. This is a security measure that allows for dropping connections not made inside the particular network.


1 Answers

Just in case you are still having this issue, try this: edit the file

/etc/systemd/system/redis.service

commenting the line

#ProtectHome=yes

It will complain about the file change and ask you to do a

sudo systemctl daemon-reload

That should do it

sudo service redis-server restart
like image 131
Marcos Besteiro López Avatar answered Oct 19 '22 01:10

Marcos Besteiro López