Redis安裝異常解決辦法

來源:互聯網
上載者:User

官網地址:http://redis.io/

官網下載地址:http://redis.io/download

 

1. 下載Redis源碼(tar.gz),並上傳到Linux

2. 解壓縮包:tar zxvf redis-2.8.17.tar.gz

3. 進入解壓縮後的檔案夾:cd redis-2.8.17

4. 編譯源碼:make

(1)若出現如下提示,則說明未安裝gcc,使用命令安裝gcc:yum install gcc

[root@localhost redis-2.8.17]# makecd src && make allmake[1]: Entering directory `/root/redis-2.8.17/src‘    CC adlist.o/bin/sh: cc: command not foundmake[1]: *** [adlist.o] Error 127make[1]: Leaving directory `/root/redis-2.8.17/src‘make: *** [all] Error 2

(2)若出現如下提示,則將make改為make MALLOC=libc,推測是因為編譯庫的問題。

[root@localhost redis-2.8.17]# makecd src && make allmake[1]: Entering directory `/root/redis-2.8.17/src‘    CC adlist.oIn file included from adlist.c:34:zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directoryzmalloc.h:55:2: error: #error "Newer version of jemalloc required"make[1]: *** [adlist.o] Error 1make[1]: Leaving directory `/root/redis-2.8.17/src‘make: *** [all] Error 2

5. 安裝編譯後的檔案:make install,redis可執行檔將被複製到/usr/local/bin/,但沒有配置,手動複製配置:cp redis.conf /usr/local/bin

6. 設定Redis密碼,編輯剛剛複製的設定檔:vi redis.conf,解除requirepass參數的注釋,並設定值,例如:requirepass ljx520

7. 使用設定檔啟動Redis資料庫:./redis-server redis.conf

如果看到如下的介面,那麼恭喜你,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.