redis-2.8.12的安装与使用
2015-11-16 15:12
711 查看
redis的安装
#pwd
/home/ybtang/
#wget http://download.redis.io/releases/redis-2.8.12.tar.gz
#tar zxvf redis-2.8.12.tar.gz
#cd redis-2.8.12
#make
redis的配置
#vim redis.conf
修改daemonize no为daemonize yes,让其后台运行
修改logfile "" 为logfile "/home/ybtang/redis-2.8.12/log/redis.log",指定日志输出文件
redis的启动
#src/redis-server ./redis.conf
redis的日志查看
#cat log/redis.log
[25947] 16 Nov 14:47:10.010 # Warning: no config file specified, using the default config. In order to specify a
config file use src/redis-server /path/to/redis.conf
[25947] 16 Nov 14:47:10.011 # You requested maxclients of 10000 requiring at least 10032 max file descriptors.
[25947] 16 Nov 14:47:10.011 # Redis can't set maximum open files to 10032 because of OS error: Operation not
permitted.
[25947] 16 Nov 14:47:10.011 # Current maximum open files is 1024. maxclients has been reduced to 992 to compensate
for low ulimit. If you need higher maxclients increase 'ulimit -n'.
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 2.8.12 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in stand alone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 25947
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
[25947] 16 Nov 14:47:10.013 # Server started, Redis version 2.8.12
[25947] 16 Nov 14:47:10.014 # WARNING overcommit_memory is set to 0! Background save may fail under low memory
condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command
'sysctl vm.overcommit_memory=1' for this to take effect.
[25947] 16 Nov 14:47:10.014 * The server is now ready to accept connections on port 6379
redis启动成功,端口号为6379
redis的访问
在令一个终端中启动redis客户端
# src/redis-cli
127.0.0.1:6379> set name tang
127.0.0.1:6379> set sex f
127.0.0.1:6379> set age 20
127.0.0.1:6379> get name
"tang"
127.0.0.1:6379> get sex
"f"
127.0.0.1:6379> get age
"20"
redis的停止
# src/redis-cli
127.0.0.1:6379>shutdown
#pwd
/home/ybtang/
#wget http://download.redis.io/releases/redis-2.8.12.tar.gz
#tar zxvf redis-2.8.12.tar.gz
#cd redis-2.8.12
#make
redis的配置
#vim redis.conf
修改daemonize no为daemonize yes,让其后台运行
修改logfile "" 为logfile "/home/ybtang/redis-2.8.12/log/redis.log",指定日志输出文件
redis的启动
#src/redis-server ./redis.conf
redis的日志查看
#cat log/redis.log
[25947] 16 Nov 14:47:10.010 # Warning: no config file specified, using the default config. In order to specify a
config file use src/redis-server /path/to/redis.conf
[25947] 16 Nov 14:47:10.011 # You requested maxclients of 10000 requiring at least 10032 max file descriptors.
[25947] 16 Nov 14:47:10.011 # Redis can't set maximum open files to 10032 because of OS error: Operation not
permitted.
[25947] 16 Nov 14:47:10.011 # Current maximum open files is 1024. maxclients has been reduced to 992 to compensate
for low ulimit. If you need higher maxclients increase 'ulimit -n'.
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 2.8.12 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in stand alone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 25947
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
[25947] 16 Nov 14:47:10.013 # Server started, Redis version 2.8.12
[25947] 16 Nov 14:47:10.014 # WARNING overcommit_memory is set to 0! Background save may fail under low memory
condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command
'sysctl vm.overcommit_memory=1' for this to take effect.
[25947] 16 Nov 14:47:10.014 * The server is now ready to accept connections on port 6379
redis启动成功,端口号为6379
redis的访问
在令一个终端中启动redis客户端
# src/redis-cli
127.0.0.1:6379> set name tang
127.0.0.1:6379> set sex f
127.0.0.1:6379> set age 20
127.0.0.1:6379> get name
"tang"
127.0.0.1:6379> get sex
"f"
127.0.0.1:6379> get age
"20"
redis的停止
# src/redis-cli
127.0.0.1:6379>shutdown
相关文章推荐
- Linux socket 初步
- linux lsof详解
- linux 文件权限
- Linux 执行数学运算
- 10 篇对初学者和专家都有用的 Linux 命令教程
- Linux 与 Windows 对UNICODE 的处理方式
- Ubuntu12.04下QQ完美走起啊!走起啊!有木有啊!
- 解決Linux下Android开发真机调试设备不被识别问题
- 运维入门
- 运维提升
- Linux 自检和 SystemTap
- Ubuntu Linux使用体验
- redis安装问题小结
- c语言实现hashmap(转载)
- Linux 信号signal处理机制
- linux下mysql添加用户
- Scientific Linux 5.5 图形安装教程
- 基于 Linux 集群环境上 GPFS 的问题诊断
- 谁是桌面王者?Win PK Linux三大镇山之宝