Refer to the operation guide provided by the redis official website. The official website address is https://redis.io/download. There are download and installation methods at the bottom.
Create directory to download the compressed package
wget https://download.redis.io/releases/redis-6.2.4.tar.gz
Decompression
tar There is a redis description file "README.md", you have time to learn about it)
1. Compile
make
yum install gcc
Deletemake distclean
2. Verification CompileGo to the "src" directory and run the "redis-server" file
3. Set up system startup
1. Install redisThe path can be customized. If the "PREFIX" parameter is not carried, redis will be installed in "/usr/ local/bin" directory.
make install PREFIX=/opt/xxx/redis 2. Set environment variables##vi / etc/profile
export REDIS_HONE=/opt/xxx/redisexport PATH=$PATH:$REDIS_HOME/bin
Enable Environment variables take effect
Enter the "utils" directory (in the decompressed redis directory).
Use the script file provided by redis to create a redis instance
cd utils./install_server.sh
Note:
The following errors can be solved by modifying the "install_server.sh" file.
Comment out the following area (version 6.2.4, around line 76)
The instance is created successfully, and the information corresponding to the instance can be seen in the corresponding directory. Multiple instances can be created, but the port numbers cannot be the same.
The above is the detailed content of How to install and configure redis in CentOS. For more information, please follow other related articles on the PHP Chinese website!