Home > Database > Redis > How to deploy and install Redis 6.2.0 using CentOS 7.5 source package

How to deploy and install Redis 6.2.0 using CentOS 7.5 source package

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2023-06-03 11:16:03
forward
1573 people have browsed it

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 </usr/local/redis/bin/redis-server /etc/redis.conf
EOF

Open Redis
/usr/local/redis/bin/redis-server /etc/redis/redis.conf

cat >> /etc/profile < ;export PATH=/usr/local/redis/bin:$PATH
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!

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template