作者:E4b9a6, 创建:2021-11-18, 字数:559, 已阅:107, 最后更新:2024-03-10
首先安装编译所需的gcc
sudo yum install -y gcc
以安装6.2.6
为例,下载redis
并解压,然后安装到/usr/local/redis
中
mkdir /tmp/redis && cd /tmp/redis
wget https://download.redis.io/releases/redis-6.2.6.tar.gz
tar -zxvf redis-6.2.6.tar.gz
cd /tmp/redis/redis-6.2.6
make MALLOC=libc
make install PREFIX=/usr/local/redis
编译安装后,复制模板配置文件到redis
的安装目录,并根据需要修改配置文件中的daemonize
(yes为后台运行)和requirepass
(连接密码)
cp /tmp/redis-6.2.6/redis.conf /usr/local/redis/bin/
最后是启动后台运行
/usr/local/redis/bin/redis-server /usr/local/redis/bin/redis.conf