Redis安装

Redis的单机版安装更像是开箱即用的感觉,为了初步的使用Redis,我首先在本地安装了一个Redis以便练习一些基本语法^-^。

[root@master local]# tar -zxvf redis-3.0.0.tar.gz
[root@master local]# ls
bin  etc  games  include  lib  lib64  libexec  mysql  redis-3.0.0  redis-3.0.0.tar.gz  sbin  share  src
[root@master local]# cd redis-3.0.0
[root@master redis-3.0.0]# make
[root@master redis-3.0.0]# make install
[root@master redis-3.0.0]# cp redis.conf conf/
[root@master redis-3.0.0]# cd conf/
[root@master redis-3.0.0]# redis-server
63322:C 22 Jan 14:25:53.166 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 3.0.0 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 63322
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               

63322:M 22 Jan 14:25:53.179 # Server started, Redis version 3.0.0
63322:M 22 Jan 14:25:53.183 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
63322:M 22 Jan 14:25:53.195 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
63322:M 22 Jan 14:25:53.195 * The server is now ready to accept connections on port 6379


登录Redis-cli测试
[root@master ~]# redis-cli
127.0.0.1:6379> select 1
OK
127.0.0.1:6379[1]> 

关闭Redis

[root@master redis-3.0.0]# redis-cli shutdown
63373:M 22 Jan 14:46:25.356 * DB loaded from disk: 0.000 seconds
63373:M 22 Jan 14:46:25.356 * The server is now ready to accept connections on port 6379
63373:M 22 Jan 14:46:43.833 # User requested shutdown...
63373:M 22 Jan 14:46:43.833 * Saving the final RDB snapshot before exiting.
63373:M 22 Jan 14:46:43.835 * DB saved on disk
63373:M 22 Jan 14:46:43.835 # Redis is now ready to exit, bye bye...

比较基础,希望对大伙有些帮助。
最后还有一点,可能有的机器安装时会缺少一些C语言编译环境,

    yum -y install cpp
    yum -y install binutils
    yum -y install glibc
    yum -y install glibc-kernheaders
    yum -y install glibc-common
    yum -y install glibc-devel
    yum -y install gcc
    yum -y install make

参考:http://xueliang1yi.blog.163.com/blog/static/1145570162012102114635764/

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值