官方指导
$ wget http://download.redis.io/releases/redis-6.0.5.tar.gz
$ tar xzf redis-6.0.5.tar.gz
$ cd redis-6.0.5
$ make
$ src/redis-server
$ src/redis-cli redis> set foo bar OK redis> get foo "bar"
成功??
此记录安装版本为5.0.5 工具xshell6
下载地址
http://download.redis.io/releases/redis-5.0.5.tar.gz
$ lz #命令上传
$ tar -zxvf redis-5.0.5.tar.gz #解压
进入 cd redis-5.0.5
$ make #构建
报错了------
make[1]: Leaving directory `/home/xc/redis-5.0.5/src'
ERROR2
缺少gcc环境需要yum install gcc(这一步或许在make时可以同步执行一下)
继续执行
报错了---------
you need tcl
#命令安装
yum install -y tcl
继续执行
$ make
结果
Hint: It's a good idea to run 'make test' ;
继续执行
$ make test
结果
然后进入utils 执行 ./install_server.sh
[root@xc01 redis-5.0.5]# cd utils [root@xc01 redis-5.0.5]# ./install_server.sh
报错了-------
Mmmmm… it seems like you don’t have a redis executable. Did you run make install yet?
在redis-5.0.5下面执行下 make install redis (进行编译一下)
[root@xc01 redis-5.0.5]# make install redis
然后在重复 ./install_server.sh 命令
若是还失败可尝试命令
make clean 从make重新开始
成功后 执行命令
src/redis-server
[root@xc01 redis-5.0.5]# src/redis-server 17092:C 18 Jun 2020 15:55:49.524 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo 17092:C 18 Jun 2020 15:55:49.524 # Redis version=5.0.5, bits=64, commit=00000000, modified=0, pid=17092, just started 17092:C 18 Jun 2020 15:55:49.524 # Warning: no config file specified, using the default config. In order to specify a config file use src/redis-server /path/to/redis.conf 17092:M 18 Jun 2020 15:55:49.525 * Increased maximum number of open files to 10032 (it was originally set to 1024). 17092:M 18 Jun 2020 15:55:49.528 # Could not create server TCP listening socket *:6379: bind: Address already in use
显示被使用
尝试下链接
src/redis-cli
[root@xc01 redis-5.0.5]# src/redis-cli 127.0.0.1:6379> set foo bar OK 127.0.0.1:6379> get foo "bar" 127.0.0.1:6379>
竟然能用了 —。—!