1.安装
- wget http://download.redis.io/releases/redis-3.2.8.tar.gz
- tar -zxvf redis-3.2.8.tar.gz
- sudo mv ./redis-3.2.8 /usr/local/redis/
- cd /usr/local/redis/
- sudo make
- sudo make test 报错:
(base) tt@burry:/usr/local/redis$ sudo make test
cd src && make test
make[1]: 进入目录“/usr/local/redis/src”
You need tcl 8.5 or newer in order to run the Redis test
Makefile:225: recipe for target ‘test’ failed
make[1]: *** [test] Error 1
make[1]: 离开目录“/usr/local/redis/src”
Makefile:6: recipe for target ‘test’ failed
make: *** [test] Error 2
参考这个解决:Linux 安装 Redis 测试时 You need tcl 8.5 or newer in order to run the Redis test 错误解决
遇到这个问题
!!! WARNING The following tests failed:
*** [err]: Test replication partial resync: ok psync (diskless: yes, reconnect: 1) in tests/integration/replication-psync.tcl
Expected condition ‘[s -1 sync_partial_ok] > 0’ to be true ([s -1 sync_partial_ok] > 0)
Cleanup: may take some time… OK
Makefile:225: recipe for target ‘test’ failed
make[1]: *** [test] Error 1
make[1]: 离开目录“/usr/local/redis/src”
Makefile:6: recipe for target ‘test’ failed
make: *** [test] Error 2
解决:1.只用单核运行 make test
taskset -c 1 sudo make test
参考:https://blog.csdn.net/u013889838/article/details/85261300?utm_medium=distribute.pc_relevant.none-task-blog-baidujs_title-8&spm=1001.2101.3001.4242
7. sudo make install
2. 配置
-
cd /usr/local/redis/
-
在 /etc/下面创建redis文件夹,sudo cp redis.conf /etc/redis/redis.conf
-
sudo vi /etc/redis/redis.conf
主要修改了 daemonize no 为yes 以及在var/lib下创建 redis目录,再修改 dir后的目录路径
3. 启动
sudo redis-server /etc/redis/redis.conf
使用另一个私密博客中的程序测试
4. Win里redis可视化客户端查看
一开始没有连上,后解决:
将 服务器端bind 127.0.0.1注释掉 (bind相当于你绑定了这台电脑,别的电脑不是127.0 .0.1,就访问不了)
提示如下错误:
解决:将配置文件中的protected mode改为 no
解决,可以查看