红联Linux门户
Linux帮助

在Ubuntu 14.04 64bit上安装redis 3.0.3

发布时间:2015-09-08 09:52:25来源:linux网站作者:雪峰流云

1.下载安装:
cd /tmp
wget http://download.redis.io/releases/redis-3.0.3.tar.gz
tar -zxf redis-3.0.3.tar.gz
cd redis-3.0.3
make
sudo make install


2.下载配置文件和init启动脚本:
wget https://github.com/ijonas/dotfiles/raw/master/etc/init.d/redis-server
wget https://github.com/ijonas/dotfiles/raw/master/etc/redis.conf
sudo mv redis-server /etc/init.d/redis-server
sudo chmod +x /etc/init.d/redis-server
sudo mv redis.conf /etc/redis.conf


3.初始化用户和日志路径
第一次启动Redis前,建议为Redis单独建立一个用户,并新建data和日志文件夹
sudo useradd redis
sudo mkdir -p /var/lib/redis
sudo mkdir -p /var/log/redis
sudo chown redis.redis /var/lib/redis
sudo chown redis.redis /var/log/redis


4.设置开机自动启动,关机自动关闭
sudo update-rc.d redis-server defaults


5.启动Redis:
sudo /etc/init.d/redis-server start


6.启动client客户端连接:
$ redis-cli
redis> set foo bar
OK
redis> get foo
"bar"


Ubuntu server 15.0.4安装Redis:http://www.linuxdiyf.com/linux/13400.html

Redis的三种启动方式:http://www.linuxdiyf.com/linux/13401.html

Ubuntu server 15.0.4安装Redis make命令不能执行:http://www.linuxdiyf.com/linux/13399.html

RedHat Linux下Redis安装:http://www.linuxdiyf.com/linux/12066.html

Linux下PHP扩展Redis全攻略:http://www.linuxdiyf.com/linux/10849.html