Install Redis 6.2.0
wget http://download.redis.io/releases/redis-6.2.0.tar.gz
yum -y install gcc automake autoconf libtool make
tar - xzvf redis-6.2.0.tar.gz && redis-6.2.0.tar.gz
cd redis-6.2.0
make
cd src
make install PREFIX=/usr/local/ redis
If zmalloc.h:50:31: Fatal error occurs: jemalloc/jemalloc.h: There is no such file or directory, then run the command
make MALLOC=libc
cd ../
mkdir /etc/redis
mv redis.conf /etc/redis/
vim /etc/redis/redis.conf
//Change daemonize no to daemonize yes. Enter the number of lines gg to quickly skip lines. For example, jump to line 138 and enter: 138gg
//Comment line 70 bind
//Change protected-mode on line 90 to no
//Uncomment line 502 and change the password
Add Redis to boot
cat >> /etc/rc.local <
EOF
Open Redis
/usr/local/redis/bin/redis-server /etc/redis/redis.conf
cat >> /etc/profile < ;
EOF
source /etc/profile
Common commands
redis-server /etc/ redis.conf //Start Redis
pkill redis //Stop Redis
Restart Redis:
#First query the pid of Redis, kill it, and then restart
[root@localhost bin ]# ps -elf | grep -v grep | grep redis
root 20940 1 0 12:12 ? 00:00:18 ./redis-server *:6379
[root@localhost bin]# kill 20940
[root@localhost bin]# redis-server redis.conf
Use Redis Desktop Manager to remotely connect to the Redis server
Uninstall Redis:
rm -rf /usr/local/redis //Delete Installation directory
rm -rf /usr/bin/redis-* //Delete all Redis related command scripts
rm -rf /root/download/redis-6.2.0 //Delete the Redis decompression folder
The above is the detailed content of How to deploy and install Redis 6.2.0 using CentOS 7.5 source package. For more information, please follow other related articles on the PHP Chinese website!