Centos redis installation and configuration

The installation command yum install redis
Modify the configuration vim /etc/redis.conf where you

need to modify:
1. pidfile specify your own location
   pidfile /data/redis/6379/redis.pid
2. bind If you need external network access, bind 127.0.0.1 Comment out
   or bind to allow access to the ip
3, dir directory to modify the default path
   dir /data/redis/6379
4, rename-command CONFIG "" Uncomment
5, the daemonize option controls whether to run in the background, change to no
6, optional password requirepass asd123

start command redis-server /etc/redis.conf
connect client redis-cli -h xxx.xxx.xxx.xxx -p xxxx -a asd123
close redis redis-cli shutdown

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326473901&siteId=291194637