Redis
安装
- 创建运行redis的单独用户,用户名redis:useradd redis
- 切换到redis用户:su - redis
- 下载redis源码:wget http://download.redis.io/releases/redis-3.0.7.tar.gz
- tar xzf redis-3.0.7.tar.gz
- cd redis-3.0.7
- make
编辑redis.conf
daemonize yes pidfile /tmp/redis.pid port 13344 bind 127.0.0.1 logfile "/home/redis/redis.log" dir /home/redis/data rename-command FLUSHALL "" rename-command CONFIG "" rename-command EVAL ""
配置开机自启动
- 切换到root用户
- cp /home/redis/redis-3.0.7/utils/redis_init_script /etc/init.d/redisd
vim /etc/init.d/redisd, 修改如下项:
chkconfig redisd on
- 启动/关闭:service redisd start/stop