Linux(Redhat)下redis安装

原文:http://www.javaweb1024.com/data/NoSQL/2015/06/29/785.html

redis是当前比较热门的NOSQL系统之一,它是一个key-value存储系统。和Memcached类似,但很大程度补偿了memcached的不足,它支持存储的value类型相对更多,包括string、list、set、zset和hash。这些数据类型都支持push/pop、add/remove及取交集并集和差集及更丰富的操作。在此基础上,redis支持各种不同方式的排序。Redis数据都是缓存在计算机内存中,并且会周期性的把更新的数据写入磁盘或者把修改操作写入追加的记录文件。

版本:3.0.2

下载地址:http://download.redis.io/releases/redis-3.0.2.tar.gz

下载完以后,放在/home目录下

[root@localhost home]# tar -zxvf redis-3.0.2.tar.gz

附:我把名字默认目录redis-3.0.2 改为redis

[root@localhost home]# cd redis

[root@localhost redis]# make

启动 redis 与之前版本不一样, redis的启动放在src下

[root@localhost src]# ./redis-server ../redis.conf

出现

8169:M 28 Jun 20:48:09.191 * Increased maximum number of open files to 10032 (it was originally set to 1024).

8169:M 28 Jun 20:48:09.199 # Warning: 32 bit instance detected but no memory limit set. Setting 3 GB maxmemory limit with ‘noeviction’ policy now.

                _._                                                 

           _.-“__ ”-._                                            

      _.-“    `.  `_.  ”-._           Redis 3.0.2 (00000000/0) 32 bit

  .-“ .-“`.  “`\/    _.,_ ”-._                                  

 (    ‘      ,       .-`  | `,    )     Running in standalone mode

 |`-._`-…-` __…-.“-._|’` _.-‘|     Port: 6379

 |    `-._   `._    /     _.-‘    |     PID: 8169

  `-._    `-._  `-./  _.-‘    _.-‘                                  

 |`-._`-._    `-.__.-‘    _.-‘_.-‘|                                 

 |    `-._`-._        _.-‘_.-‘    |           http://redis.io       

  `-._    `-._`-.__.-‘_.-‘    _.-‘                                  

 |`-._`-._    `-.__.-‘    _.-‘_.-‘|                                 

 |    `-._`-._        _.-‘_.-‘    |                                 

  `-._    `-._`-.__.-‘_.-‘    _.-‘                                  

      `-._    `-.__.-‘    _.-‘                                      

          `-._        _.-‘                                          

              `-.__.-‘                                              

 

8169:M 28 Jun 20:48:09.199 # Server started, Redis version 3.0.2

8169:M 28 Jun 20:48:09.200 # 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.

8169:M 28 Jun 20:48:09.200 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.

8169:M 28 Jun 20:48:09.200 * The server is now ready to accept connections on port 6379

8169:M 28 Jun 21:03:10.091 * 1 changes in 900 seconds. Saving…

8169:M 28 Jun 21:03:10.093 * Background saving started by pid 8311

8311:C 28 Jun 21:03:10.111 * DB saved on disk

8311:C 28 Jun 21:03:10.113 * RDB: 0 MB of memory used by copy-on-write

8169:M 28 Jun 21:03:10.193 * Background saving terminated with success

测试

[root@localhost src]# ./redis-cli

127.0.0.1:6379> set foo 1

OK

127.0.0.1:6379> get foo

“1”

127.0.0.1:6379> TYPE foo

string

127.0.0.1:6379>

表示成功

 

    原文作者:noSql
    原文地址: https://www.cnblogs.com/zihan1120/p/4607352.html
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞