檢查安裝依賴程序c++
yum install gcc-c++ yum install -y tcl
獲取安裝文件redis
wget http://download.redis.io/releases/redis-3.2.9.tar.gz tar xzf redis-3.2.9.tar.gz mv redis-3.2.9 /usr/local/redis
進入目錄vim
cd /usr/local/redis
編譯安裝code
make make install
設置配置文件目錄server
mkdir -p /etc/redis cp redis.conf /etc/redis
修改配置文件get
vim /etc/redis/redis.conf daemonize yes (no -> yes)
啓動io
/usr/local/bin/redis-server /etc/redis/redis.conf
查看啓動編譯
ps -ef | grep redis
使用客戶端登錄
redis-cli set name Joe Ok
關閉客戶端cli
redis-cli shutdown
開機啓動配置
# 開機啓動要配置在 rc.local 中,而 /etc/profile 文件,要有用戶登陸了,纔會被執行。 echo "/usr/local/bin/redis-server /etc/redis/redis.conf &" >> /etc/rc.local