linux下安装redis

linux下安装redis首先需要安装gcc,它是用来编译redis的源文件的

1.安装gcc ,前提是切换root用户,途中会出现两次选择,都按输入y

[root@centos-linux zhongkai]# yum install gcc-c++


2.去redis官网下载redis软件  https://redis.io/


3.解压redis

[root@centos-linux zhongkai]# cd Documents/
[root@centos-linux Documents]# ls
redis-4.0.9.tar.gz

[root@centos-linux Documents]# tar zxvf redis-4.0.9.tar.gz 


4.使用make命令编译

[root@centos-linux Documents]# ls
redis-4.0.9  redis-4.0.9.tar.gz
[root@centos-linux Documents]# cd redis-4.0.9/

[root@centos-linux redis-4.0.9]# make


5.进入解压的src目录

[root@centos-linux src]# make test
    CC Makefile.dep
You need tcl 8.5 or newer in order to run the Redis test

make: *** [test] 错误 1

解决报错:

    到这里会出现错误是很正常的,去下载tcl工具脚本语言,是Linux内的一种语言包

    网址:http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz

[root@centos-linux tcl8.6.1]#cd unix/ 

[root@centos-linux unix]#./cinfigure

[root@centos-linux unix]#cd make 

[root@centos-linux unix]#cd make unstall

再执行 [root@centos-linux src]# make test

以下结果表示成功


安装:

[root@centos-linux src]# make PREFIX=/usr/local/redis install 


以上显示表示安装成功

启动:

[root@centos-linux bin]# ./redis-server 
10783:C 15 May 15:00:58.821 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
10783:C 15 May 15:00:58.822 # Redis version=4.0.9, bits=64, commit=00000000, modified=0, pid=10783, just started
10783:C 15 May 15:00:58.822 # Warning: no config file specified, using the default config. In order to specify a config file use ./redis-server /path/to/redis.conf
10783:M 15 May 15:00:58.823 * Increased maximum number of open files to 10032 (it was originally set to 1024).
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 4.0.9 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 10783
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                        








  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值