redis6.0在centos7上的安装
用wget 命令安装
mkdir -p /usr/loacl/src
yum install -y wget
wget -P /usr/local/src https://download.redis.io/releases/redis-6.0.9.tar.gz
cd /usr/local/src
tar -xzvf redis-6.0.9.tar.gz
安装redis环境依赖
yum install -y gcc-c++ autoconf automake
cd /usr/local/src/redis-6.0.9
yum install -y centos-release-scl scl-utils-build
yum install -y devtoolset-9-toolchain
scl enable devtoolset-9 bash
gcc -v
开始编译安装redis
cd /usr/local/src/redis-6.0.9
make
mkdir -p /usr/local/redis
make PREFIX=/usr/local/redis install
编译报错
/opt/rh/devtoolset-9/root/usr/libexec/gcc/aarch64-redhat-linux/9/ld: 找不到 -latomic collect2: error: ld returned 1 exit status
解决办法
find / -name "libatomic.so*"
yum -y install *atomic* --skip-broken
上述方发不行可以参考这篇博客 https://www.cnblogs.com/mafy/p/13380332.html
编译成功
安装成功
开始配置redis
./redis-server
cd /usr/local/src/redis-6.0.9
cp redis.conf /usr/local/redis/bin
daemonize yes
./redis-server ./redis.conf
配置开机启动
vi /etc/systemd/system/redis.service
[Unit]
Description=redis-server
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/redis/bin/redis-server /usr/local/redis/bin/redis.conf
PrivateTmp=true
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl stop redis.service
systemctl start redis.service
systemctl restart redis.service
systemctl enable redis.service
|