Redis is no longer a rare thing, but it is definitely an artifact.
1 ready
1、 A computer that can connect to the Internet (this article takes centos7 as an example)
2 start installation
1、 Check if it has been installed before (ps -ef|grep redis)
Because I have installed it locally, so there is the above record, otherwise it is empty
2、 Install gcc-c++ (needed by redis compilation environment)
sudo yum install gcc-c++
3、 Download the source code locally (wget http://download.redis.io/releases/redis-the version you need.tar.gz---I downloaded 3.2.8)
I downloaded it to user/local
4、 Unzip (tar -zxvf redis-3.2.8.tar.gz)
5、 Compile
Enter redis-3.2.8 (cd redis-3.2.8)
Execute make && make install
At this time, there will be a few more files in the src directory (green in the figure below)
3 Configuration
1、 Create redis/etc and redis/bin directories under local to store configuration files and startup files respectively
2、 Copy redis-3.2.8/redis.conf to redis/etc
3、 Move the green file generated in step 5 above into redis/bin
4、 Configure redis/etc/redis.conf
Mainly revised:
requirepass 123456789 (Let go of this line and configure your own password)
daemonize yes (redis running in the background)
5、 Start (./user/local/redis/bin/redis-server /user/local/redis/etc/redis.conf)
Note: Because it is running in the background, the redis startup diagram (startup log and other information) will not appear here
4 test
Test the connection with redis manager desktop locally
5 Problems encountered
**Q1: **An error is reported when executing make:
cc: Error: ../deps/hiredis/libhiredis.a: No such file or directory
cc: Error: ../deps/lua/src/liblua.a: No such file or directory
cc: Error: ../deps/geohash-int/geohash.o: No such file or directory
cc: Error: ../deps/geohash-int/geohash_helper.o: No such file or directory
make[1]: *** [redis-server] Error 1
make[1]: leave the directory "/usr/local/redis-3.2.8/src"
make: *** [all] Error 2
**A1: **Enter redis-3.2.8/deps, execute make geohash-int hiredis jemalloc linenoise lua
**Q2: **The configuration is all right, but the local connection cannot be made
**A2: **Most are firewall problems
systemctl stop firewalld.service #Stop firewall
systemctl disable firewalld.service #Prohibit firewall from booting up
Recommended Posts