Objective
Recently using Redis, here is a simple way to write the installation and configuration of Redis under Mac and CentOS.
Under Install Mac
installation command:brew intall redis
To run the command:brew services start redis
Centos
CentOS runs under the SU user, or add sudo
installation command:yum install redis
To run the command:service redis start
Configure Mac
Under Mac, its configuration file path is/usr/local/etc/redis.conf
Centos
Under CentOS, its configuration file path is/etc/redis.conf
Note that the SU Editor is used under CentOS.
Content
Redis mainly needs to configure the listening port and password, Mac and CentOS version of the configuration file content.
By default, Redis listens for 127.0.0.1, which can be changed to an IP address or 0.0.0.0 (which means listening for all IPs)
bind 127.0.0.1requirepass zch
Attention
Under CentOS, if you change your password, restarting directly with a command service redis restart
will fail. The reason is because the authentication failed (I guess).
It ps -ef|grep redis
would be nice to find the process and start it again.
Installation and configuration of Redis under Mac and CentOS