reids使用
2015-07-18 00:00
751 查看
摘要: centos6.4安装 配置 redis 添加开机启动redis
Redis安装:
参考:http://tianshili.blog.51cto.com/5050423/1638506
Redis配置:
Redis配置多个端口启动:
1. 复制/usr/local/redis/etc/redis-6379.conf
cp /usr/local/redis/etc/redis-6379.conf /usr/local/redis/etc/redis-6380.conf
cp /usr/local/redis/etc/redis-6379.conf /usr/local/redis/etc/redis-6381.conf
cp /usr/local/redis/etc/redis-6379.conf /usr/local/redis/etc/redis-6382.conf
...
2. 修改对应的配置文件redis-xxxx.conf
pidfile /var/run/redis-6379.pid -->pidfile /var/run/redis-6380.pid
port 6379 --> port 6380
logfile "/usr/local/redis/log/redis-6379.log" --> logfile "/usr/local/redis/log/redis-6380.log"
dbfilename dump-6379.rdb --> dbfilename dump-6380.rdb
3. 启动多个实例
/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis-6379.conf
/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis-6380.conf
/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis-6381.conf
...
Redis开机启动:
在/etc/rc.local中加入启动redis的命令即可:
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis-6379.conf
/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis-6380.conf
/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis-6381.conf
...
重启系统即可自动启动redis-->reboot
Redis安装:
参考:http://tianshili.blog.51cto.com/5050423/1638506
Redis配置:
Redis配置多个端口启动:
1. 复制/usr/local/redis/etc/redis-6379.conf
cp /usr/local/redis/etc/redis-6379.conf /usr/local/redis/etc/redis-6380.conf
cp /usr/local/redis/etc/redis-6379.conf /usr/local/redis/etc/redis-6381.conf
cp /usr/local/redis/etc/redis-6379.conf /usr/local/redis/etc/redis-6382.conf
...
2. 修改对应的配置文件redis-xxxx.conf
pidfile /var/run/redis-6379.pid -->pidfile /var/run/redis-6380.pid
port 6379 --> port 6380
logfile "/usr/local/redis/log/redis-6379.log" --> logfile "/usr/local/redis/log/redis-6380.log"
dbfilename dump-6379.rdb --> dbfilename dump-6380.rdb
3. 启动多个实例
/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis-6379.conf
/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis-6380.conf
/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis-6381.conf
...
Redis开机启动:
在/etc/rc.local中加入启动redis的命令即可:
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis-6379.conf
/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis-6380.conf
/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis-6381.conf
...
重启系统即可自动启动redis-->reboot
相关文章推荐
- redis安装问题小结
- Redis偶发连接失败案例实战记录
- Redis中实现查找某个值的范围
- Redis和Memcached的区别详解
- 分割超大Redis数据库例子
- Redis总结笔记(一):安装和常用命令
- Redis sort 排序命令详解
- redis中修改配置文件中的端口号 密码方法
- 在Ruby on Rails上使用Redis Store的方法
- Redis和Memcache的区别总结
- 在Node.js应用中使用Redis的方法简介
- Redis服务器的启动过程分析
- web 应用中常用的各种 cache详解
- 利用yum安装Redis的方法详解
- 从MySQL到Redis的简单数据库迁移方法
- 为啥懒 Redis 是更好的 Redis
- 在Redis数据库中实现分布式速率限制的方法
- redis2.8配置文件中文翻译版
- 详解Redis使用认证密码登录
- Redis 在真实世界的 5 个用法