Redis配置和启动【转】
启动redis时候提示:
ARE YOU SURE YOU WANT TO USE VM?
Redis Virtual Memory is going to be deprecated soon,
we think you should NOT use it, but use Redis only if
your data is suitable for an in-memory database.
If you *really* want VM add this in the config file:
really-use-vm yes本机测试, 觉得没有必要,就注释掉了
#vm-enabled yes
From: http://www.cnblogs.com/viaivi/archive/2011/12/08/2281319.html
================
1、下载安装
cd /tmpwget <a href="http://redis.googlecode.com/files/redis-">http://redis.googlecode.com/files/redis-</a>
2.2.13.tar.gztar -zxf redis-2.2.13.tar.gzcd redis-2.2.13makesudo make install |
这时Redis 的可执行文件被放到了/usr/local/bin
2、下载配置文件和init启动脚本:
wget <a href="https://github.com/ijonas/dotfiles/raw/master/etc/init.d/redis-server">https://github.com/ijonas/dotfiles/raw/master/etc/init.d/redis-server</a>
wget <a href="https://github.com/ijonas/dotfiles/raw/master/etc/redis.conf">https://github.com/ijonas/dotfiles/raw/master/etc/redis.conf</a>
sudo mv redis-server /etc/init.d/redis-serversudo chmod +x /etc/init.d/redis-serversudo mv redis.conf /etc/redis.conf |
3、初始化用户和日志路径
第一次启动Redis前,建议为Redis单独建立一个用户,并新建data和日志文件夹
sudo useradd redissudo mkdir -p /var/lib/redissudo mkdir -p /var/log/redissudo chown redis.redis /var/lib/redissudo 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-cliredis> set foo barOKredis> get foo"bar" |
相关推荐
王道革 2020-11-25
wangdonghello 2020-11-03
chenhualong0 2020-11-16
聚合室 2020-11-16
koushr 2020-11-12
guoyanga 2020-11-10
fackyou00 2020-11-10
Orangesss 2020-11-03
dongCSDN 2020-10-31
Quietboy 2020-10-30
liuyulong 2020-10-29
fansili 2020-10-29
温攀峰 2020-10-23
jackbon 2020-10-19
kaixinfelix 2020-10-04