Linux版安装流程
- 获取最新的版本
https://redis.io/download
- 下载,解压,编译
1 2 3 4
| $ wget https://download.redis.io/releases/redis-6.0.10.tar.gz $ tar xzf redis-6.0.10.tar.gz $ cd redis-6.0.10 $ make
|
- 测试
1 2 3 4 5
| $ src/redis-cli redis> set foo bar OK redis> get foo "bar"
|
注意
- Redis 6需要gcc的版本为5.3以上
1 2 3 4 5
| yum -y install centos-release-scl yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils
scl enable devtoolset-9 bash
|
scl命令启用只是临时的,推出xshell或者重启就会恢复到原来的gcc版本。
如果要长期生效的话,执行如下:
1
| echo "source /opt/rh/devtoolset-9/enable" >>/etc/profile
|
- 遇到fatal error
Reference
https://blog.csdn.net/hello_cmy/article/details/106062327
https://blog.csdn.net/libra_ts/article/details/71195128