Linux(Redhat)下redis安裝

來源:互聯網
上載者:User

標籤:

原文: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目錄下

[[email protected] home]# tar -zxvf redis-3.0.2.tar.gz

附:我把名字預設目錄redis-3.0.2 改為redis

[[email protected] home]# cd redis

[[email protected] redis]# make

啟動 redis 與之前版本不一樣, redis的啟動放在src下

[[email protected] 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

測試

[[email protected] 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>

表示成功

 

Linux(Redhat)下redis安裝

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.