參考http://redis.io/topics/quickstart
下載安裝redis stable
wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
sudo make
把src資料夾內 redis-server 和 redis-cli 加到路徑
cd src
sudo cp redis-server /usr/local/bin/
sudo cp redis-cli /usr/local/bin/
測試redis server
redis-server
>exit
設定redis成為daemon,以port 6379為例
mkdir /etc/redis
sudo mkdir /etc/redis
sudo mkdir /var/redis
sudo cp redis-stable/utils/redis_init_script /etc/init.d/redis_6379
sudo vi /etc/init.d/redis_6379
設定REDISPORT為6379
sudo cp redis-stable/redis.conf /etc/redis/6379.conf
sudo mkdir /var/redis/6379
sudo vi /etc/redis/6379.conf
設定config檔的參數daemonize yes
pidfile /var/run/redis_6379.pid
port 6379
logfile /var/log/redis_6379.log
dir /var/redis/6379
把redis init script加到開機自動執行
sudo update-rc.d redis_6379 defaults
啓動redis service
sudo /etc/init.d/redis_6379 start
redis-cli ping
>PONG
沒有留言:
張貼留言