专注JavaWeb开发 首页制式『默认式 OR 时间轴 网站地图|RSS订阅|设为首页|加入收藏
当前位置:首页 >数据库 >NoSQL > 正文

Linux(Redhat)下redis安装

作者: 紫寒1120 发布时间: 2015-06-29 浏览次数:

redis是当前比较热门的NOSQL系统之一,它是一个key-value存储系统。和Memcached类似,但很大程度补偿了memcached的不足,它支持存储的value类型相对更多,包括stringlistsetzsethash。这些数据类型都支持push/popadd/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>

表示成功


QQ群: 武汉地区(142173356)验证消息JavaWeb1024

网友共有【】评论,点击查看


相关新闻:


x 微信关注我们 随时获取最新网站资讯