Redis stand-alone installation and deployment
1. Installation depends on C language dependencies
redis is written in C language, so the C language library needs to be installed
# yum install -y gcc-c++ automake autoconf libtool make tcl
2. Upload and decompress
redis客户端
Upload redis-5.0.5.tar.gz to /usr/local/tmp
Unzip the file
# cd /usr/local/tmp
# tar zxf redis-5.0.5.tar.gz
3. Compile and install
Go to the decompression folder
# cd /usr/local/tmp/redis-5.0.5/
Compile
# make
install
# make install PREFIX=/usr/local/redis
4. Start the daemon process
Copy the redis.conf configuration file in cd /usr/local/tmp/redis-5.0.5/
# cp redis.conf /usr/local/redis/bin/
Modify the configuration file
# cd /usr/local/redis/bin/
# vim redis.conf
Change the value of daemonize from no to yes
5. Modify external access
In redis5, the configuration file redis.conf needs to be modified to allow external access. Two modifications are required.
Comment out the following
bind 127.0.0.1
#bind 127.0.0.1
Protected-mode yes changed to no
6. Start and test
start redis
# ./redis-server redis.conf
restart redis
# ./redis-cli shutdown
# ./redis-server redis.conf
Start the client tool
# ./redis-cli
In redis5, client tools will provide functions for commands.