软件版本
redis: redis-6.0.6
centos: centos7.7
安装步骤
- 创建软件目录
cd ~
mkdir soft
cd soft
- 下载redis
wget http://download.redis.io/releases/redis-6.0.6.tar.gz
- 解压
tar xzf redis-6.0.6.tar.gz
-
请先检查gcc的版本是否低于5,如果是请先升级,可以使用以下命令:
sudo yum install centos-release-scl
sudo yum install devtoolset-7-gcc*
scl enable devtoolset-7 bash
- 编译
cd redis-6.0.6
make
- 安装,将执行文件copy到指定目录
make PREFIX=/some/other/directory install
- 将执行文件目录配置到环境变量
vim /etc/profile
-- export PATH=$PATH:/REDIS_HOME/bin
source /etc/profile
- 安装为服务
cd /root/soft/redis-6.0.6/utils
编辑install_server.sh文件,注释
#_pid_1_exe="$(readlink -f /proc/1/exe)"
#if [ "${_pid_1_exe##*/}" = systemd ]
#then
# echo "This systems seems to use systemd."
# echo "Please take a look at the provided example service unit files in this directory, and adapt and install them. Sorry!"
# exit 1
./install_server.sh
一路回车即可