CentOS 6.5下Redis安裝詳細步驟

來源:互聯網
上載者:User

標籤:

Redis簡介:
Redis是一個開源的使用ANSI C語言編寫、支援網路、可基於記憶體亦可持久化的日誌型、Key-Value資料庫,並提供多種語言的API。從2010年3月15日起,Redis的開發工作由VMware主持。
redis是一個key-value儲存系統。和Memcached類似,它支援儲存的value類型相對更多,包括string(字串)、list(鏈表)、set(集合)、zset(sorted set –有序集合)和hash(雜湊類型)。這些資料類型都支援push/pop、add/remove及取交集並集和差集及更豐富的操作,而且這些操作都是原子性的。在此基礎上,redis支援各種不同方式的排序。與memcached一樣,為了保證效率,資料都是緩衝在記憶體中。區別的是redis會周期性的把更新的資料寫入磁碟或者把修改操作寫入追加的記錄檔案,並且在此基礎上實現了master-slave(主從)同步。
安裝環境:
CentOS 6.5
Redis 2.8.13
下載安裝:
下載檔案到 /opt/ 目錄下
wget http://download.redis.io/releases/redis-3.2.1.tar.gz
解壓檔案
tar zxvf redis-2.8.13.tar.gz
切換目錄到 redis-2.8.13 目錄下
cd redis-2.8.13
執行make命令,最後幾行的輸出結果
Hint: To run ‘make test’ is a good idea
make[1]: Leaving directory `/opt/redis-2.8.13/src’
執行安裝命令
make install
提示:
cd src && make install
make[1]: Entering directory `/opt/redis-2.8.13/src‘

Hint: To run ‘make test‘ is a good idea

INSTALL install
INSTALL install
INSTALL install
INSTALL install
INSTALL install
make[1]: Leaving directory `/opt/redis-2.8.13/src‘
根據提示,執行:cd src && make install
提示:
Hint: To run ‘make test‘ is a good idea

INSTALL install
INSTALL install
INSTALL install
INSTALL install
INSTALL instal
按照提示執行:make test
提示:
You need tcl 8.5 or newer in order to run the Redis test
make: *** [test] Error 1
解決方案參考:http://www.linuxfromscratch.org/blfs/view/cvs/general/tcl.html
也可以使用:yum install tcl 命令安裝
後來經搜尋發現不需要安裝,直接到src目錄下執行 ./redis-server 就可以

可以使用類似 ./redis-server /path/to/redis.conf 命令指定設定檔;
Server started, Redis version 2.8.13
The server is now ready to accept connections on port 6379
服務啟動成功,服務已經在6379連接埠上監聽串連請求。
你可以使用內建的用戶端串連Redis:http://www.redis.cn/download.html

安裝好之後,開機檔案
#啟動redis
src/redis-server &

src/redis-server redis.conf &

#關閉redis
src/redis-cli shutdown

$ src/redis-cli
redis> set foo bar
OK
redis> get foo
"bar"
注意事項:
要遠端存取它,還需要開啟防。
不要使用Ctrl+C,這樣會使程式退出。


[email protected]:~/workspace/redis2.6.13/src$ make test
You need tcl 8.5 or newer in order to run the Redis test
make: *** [test] Error 1
[html] view plain copy

1.wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz
2.sudo tar xzvf tcl8.6.1-src.tar.gz -C /usr/local/
3.cd /usr/local/tcl8.6.1/unix/
4.sudo ./configure
5.sudo make
6.sudo make install

(轉)CentOS 6.5下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.