redis-4.0.10安装(一)

时间:2024-04-11 12:51:40

本人机器ubuntu版本

[email protected]:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04 LTS
Release: 18.04
Codename: bionic

1、https://redis.io/download

终端里面输入如下命令:

[email protected]:~$ wget http://download.redis.io/releases/redis-4.0.10.tar.gz

[email protected]:~/Downloads$ tar xzf redis-4.0.10.tar.gz 

[email protected]:~/Downloads$ cd redis-4.0.10/

[email protected]:~/Downloads/redis-4.0.10$ cd src
[email protected]:~/Downloads/redis-4.0.10/src$ make install  //普通账户无权限 需要提权 所以会报错!


Hint: It's a good idea to run 'make test' ;)

   INSTALL install
install: cannot create regular file '/usr/local/bin/redis-server': Permission denied
Makefile:286: recipe for target 'install' failed

make: *** [install] Error 1


[email protected]:~$ sudo -s
[sudo] password for jd: 
[email protected]:~# cd ~/Downloads/redis-4.0.10/src

[email protected]:~/Downloads/redis-4.0.10/src# make install 

最后启动redis

[email protected]:~/Downloads/redis-4.0.10/src# redis-server

如图:

redis-4.0.10安装(一)


最后测试下吧:

[email protected]:~$ redis-cli
127.0.0.1:6379> set first_key hello
OK
127.0.0.1:6379> get first_key
"hello"
127.0.0.1:6379> 

如图:

redis-4.0.10安装(一)