標籤:
如果沒有redis安裝包可以用wget擷取#wget http://download.redis.io/releases/redis-2.8.13.tar.gz1.解壓redis包#cd /usr#mkdir redis#cd#tar zxvf redis-2.8.13.tar.gz -C /usr/redis#cd /usr/redis/redis-2.8.13 先安裝一些必要的工具,不然make的時候報錯#yum install -y gcc tcl 2.安裝#make(如果報錯error: jemalloc/jemalloc.h: No such file or directory,執行#make MALLOC=libc#make distclean#make)#make test#make install這樣就安裝完了,如果出現make[1]: Leaving directory `xxxxx/redis-2.8.13/src‘ 不用管它 #cd utils/#./install_server.sh過程中會提示輸入一些配置如連接埠、config檔案名稱等,都按斷行符號使用預設的即可 3.修改配置#vi /etc/init.d/redis_6379看下以下配置路徑是否正確
EXEC=/usr/local/bin/redis-server
CLIEXEC=/usr/local/bin/redis-cli
PIDFILE=/var/run/redis_6379.pid
CONF="/etc/redis/6379.conf"
4.設定後台運行#vi /usr/redis/redis-2.8.13/redis.confdaemonize no 改為 daemonize yes 5.更改服務名#cd /etc/init.d#mv redis_6379 redis6.設定開機啟動#chkconfig redis on
測試#redis-cli 附件:https://app.yinxiang.com/shard/s41/res/c8681ee3-dadc-480c-a365-7820ce5aeb19/redis-2.8.13.tar.gz
centos 安裝redis