redis 安装

作者: 路路有话说 | 来源:发表于2017-01-16 10:54 被阅读27次

redis 安装

[toc]

下载源文件

我们找到 redis 官网
复制一下下载链接,下载 解压缩

wget http://download.redis.io/releases/redis-3.2.6.tar.gz
tar -zxvf redis-3.2.6.tar.gz
mv redis-3.2.6 redis
cd redis/src
make install PREFIX=/usr/local/redis
cd ..
mkdir /user/local/etc/
cp redis.conf /user/local/etc/

到这里就安装结束了
但是有可能会出现一个错误

[root@localhost src]# make test
You need tcl 8.5 or newer in order to run the Redis test
make: *** [test] 错误 1
安装一个奇怪的tcl

也就是告诉你要装一个tcl, tcl。。。。
tcl 的下载地址
下载 解压 安装

wget https://nchc.dl.sourceforge.net/project/tcl/Tcl/8.6.6/tcl8.6.6-src.tar.gz
tar -zxvf tcl8.6.6-src.tar.gz 
[root@localhost Downloads]# mv tcl8.6.6 tcl
[root@localhost Downloads]# cd tcl
[root@localhost tcl]# ls
ChangeLog       ChangeLog.2000  ChangeLog.2002  ChangeLog.2004  ChangeLog.2007  changes  doc      library     license.terms  pkgs    tests  unix ChangeLog.1999  ChangeLog.2001  ChangeLog.2003  ChangeLog.2005  ChangeLog.2008  compat   generic  libtommath  macosx         README  tools  win
cd unix
[root@localhost unix]# ./configure
make && make install

这里需要注意的是需要进入到unix 目录下 因为我这里是 centos 7 其他系统估计也就目录不一样 暂时未研究

让 redis 跑起来
[root@localhost redis]# cd /usr/local/redis/
[root@localhost redis]# bin/redis-server  etc/redis.conf 
29350:M 15 Jan 18:25:39.768 * Increased maximum number of open files to 10032 (it was originally set to 1024).
            _._                                                  
       _.-``__ ''-._                                             
  _.-``    `.  `_.  ''-._           Redis 3.2.6 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 29350
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
  `-._    `-.__.-'    _.-'                                       
      `-._        _.-'                                           
          `-.__.-'                                               

出现这个东西就ok 了 但是我们惊奇的发现它居然没有后台运行 ,简直可怕 这个时候我们修改一个配置

 vi etc/redis.conf 

将daemonize的值改为yes
重新运行 bin/redis-server etc/redis.conf 即可
转载请注明来自** 李龙的博客**的 《redis 安装》

相关文章

网友评论

    本文标题:redis 安装

    本文链接:https://www.haomeiwen.com/subject/gmoubttx.html