redis 安装遇到的坑比较全面了

redis 的下载安装  百度上比较多,我们直接用的官网的

 

$ wget http://download.redis.io/releases/redis-5.0.5.tar.gz
$ tar xzf redis-5.0.5.tar.gz
$ cd redis-5.0.5
$ make

进入到解压后的 src 目录,通过如下命令启动Redis:

$ src/redis-server

您可以使用内置的客户端与Redis进行交互:

$ src/redis-cli
redis> set foo bar
OK
redis> get foo
"bar"

 但是 redis-cli和redis-server 总是命令执行失败

后来发现好像不是全局变量

 ln -s /usr/local/redis-5.0.5/src/redis-server /usr/bin/redis-server

我的redis 安装的位置是在  usr/local/下面  设置到usr/bin/ 就可以了

redis-server 也是这样做的

redis-server /usr/local/redis-5.0.5/redis.conf


最后执行 redis-cli  就启动支持了,后面设置为自启动就可以了

[root@izuf6f0icee8u4hzqypcnlz /]# redis-server /usr/local/redis-5.0.5/redis.conf
-bash: redis-server: command not found
[root@izuf6f0icee8u4hzqypcnlz /]# ln -s /usr/local/redis-5.0.5/src/redis-server /usr/bin/redis-server
[root@izuf6f0icee8u4hzqypcnlz /]# redis-server
3447:C 26 Nov 2019 23:47:16.072 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
3447:C 26 Nov 2019 23:47:16.072 # Redis version=5.0.5, bits=64, commit=00000000, modified=0, pid=3447, just started
3447:C 26 Nov 2019 23:47:16.072 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 5.0.5 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 3447
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               

 

 

 

你可能感兴趣的:(redis,redis安装遇到的问题)