Linux Redis的安裝

安裝redis編譯環境
yum install gcc-c++

安裝步驟:
第一步:redis的源碼包上傳到linux系統。怎樣上傳,請看我另一篇博客啦
點擊跳轉http://blog.csdn.net/chenxiansheng888/article/details/78358744

第二步:解壓縮redis

第三步:進入redis源碼目錄,編譯
make

第四步:安裝
make install PREFIX=/usr/local/redis
(PREFIX參數指定redis的安裝目錄。一般軟件安裝到/usr目錄下)

redis的啓動:
前端啓動:在redis的安裝目錄下直接啓動redis-server
[root@localhost bin]# ./redis-server

後臺啓動:
把/root/redis-3.0.0/redis.conf複製到/usr/local/redis/bin目錄下
[root@localhost redis-3.0.0]# cp redis.conf /usr/local/redis/bin/
修改redis.conf配置文件:no 改爲 yes
看圖說話
繼續啓動 後邊要加redis.conf配置文件
[root@localhost bin]# ./redis-server redis.conf

查看redis進程:
[root@localhost bin]# ps aux|grep redis
root 5190 0.1 0.3 33936 1712 ? Ssl 18:23 0:00 ./redis-server *:6379
root 5196 0.0 0.1 4356 728 pts/0 S+ 18:24 0:00 grep redis

redis的連接:
[root@localhost bin]# ./redis-cli
默認連接localhost運行在6379端口的redis服務。
[root@localhost bin]# ./redis-cli -h 192.168.25.153 -p 6379
(-h:連接的服務器的地址 -p:服務的端口號)

redis的關閉:
關閉redis:[root@localhost bin]# ./redis-cli shutdown

ok!!!結束!! 希望給各位猿友帶來幫助吧!!! 偷偷告訴你們!!!這是我剛寫的日記!!

發佈了41 篇原創文章 · 獲贊 14 · 訪問量 5萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章