CentOS6 安裝 Redis

centos6安裝redis-2.8.19.tar.gz

一、檢查安裝依賴程序c++

yum install gcc-c++
yum install -y tcl
yum install wget

二、獲取安裝文件redis

wget http://download.redis.io/releases/redis-2.8.13.tar.gz

三、解壓文件centos

tar -xzvf redis-2.8.19.tar.gz
mv redis-2.8.19 /usr/local/redis

四、進入目錄spa

cd /usr/local/redis

五、編譯安裝code

make
make install

六、設置配置文件路徑server

mkdir -p /etc/redis
cp redis.conf/etc/redis

七、修改配置文件get

vi /etc/redis/redis.conf
僅修改: daemonize yesno-->yes

八、啓動io

/usr/local/bin/redis-server /etc/redis/redis.conf

九、查看啓動編譯

ps -ef | grep redis

十、使用客戶端登錄

redis-cli
>set name david
OK
>get name
"david"

11.關閉客戶端

redis-cli shutdown

十二、開機啓動配置

echo "/usr/local/bin/redis-server /etc/redis/redis.conf &" >> /etc/rc.local

開機啓動要配置在 rc.local 中,而 /etc/profile 文件,要有用戶登陸了,纔會被執行。

相關文章
相關標籤/搜索