Install Redis 2.8.7
tar xvzf redis-stable.tar.gz
make under CentOS 7.
There should be no problem in the first three steps. The main problem is that an exception occurs when executing make.
make[2]: cc: Command not found
Solution: yum install gcc-c++
Exception 2:
Exception cause: Some compilation dependencies or problems left over from the original compilation
require make test after the make is successful. An exception occurred in make test.
couldn't execute "tclsh8.5": no such file or directory
Solution: yum install -y tcl.
After make is successful, there will be some more executable files in the src directory: redis-server, redis-cli, etc.
cp redis-server /usr/local/bin/
Then create a new directory to store the configuration file
mkdir /var/redis
mkdir /var/redis/run
cp redis.conf /etc/redis/6379.conf
daemonize yes
logfile /var/redis/ log/redis_6379.log
Last run redis:
$ ./redis-server /etc/redis/6379.conf
It turns out that redis can only log in to localhost by default, so you need to enable remote login. The workaround is as follows:
In the redis configuration file redis.conf, find bind localhost and comment it out.
Comment out this machine, all computers in the local area network can access.
Band localhost can only be accessed locally, and computers in the local area network cannot access it.
The bind LAN IP can only be accessed by machines with IP in the LAN, and the local localhost cannot be accessed.