Redis 单机版本安装及其启动
2016-02-16 08:49
621 查看
1.先创建reids 用户
[root@aly-lww3 ~]# yum -y install tcl
[root@aly-lww3 ~]# useradd redis
[root@aly-lww3 ~]# passwd redis
Changing password for user redis.
New password:
BAD PASSWORD: it is too short
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.
[root@aly-lww3 ~]#
2.下载安装包
[root@aly-lww3 ~]# su - redis
[redis@aly-lww3 ~]$ wget http://120.52.72.46/download.redis.io/c3pr90ntcsf0/releases/redis-3.0.6.tar.gz --2016-01-31 21:47:42-- http://120.52.72.46/download.redis.io/c3pr90ntcsf0/releases/redis-3.0.6.tar.gz Connecting to 120.52.72.46:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1372648 (1.3M) [application/x-gzip]
Saving to: “redis-3.0.6.tar.gz”
100%[==========================================================================
=================>] 1,372,648 12.5K/s in 1m 58s
2016-01-31 21:49:41 (11.3 KB/s) - “redis-3.0.6.tar.gz” saved [1372648/1372648]
3.解压安装
[redis@aly-lww3 ~]$ ll
total 1344
-rw-rw-r-- 1 redis redis 1372648 Dec 18 23:24 redis-3.0.6.tar.gz
[redis@aly-lww3 ~]$ tar -zxf redis-3.0.6.tar.gz
[redis@aly-lww3 ~]$ cd redis-3.0.6
[redis@aly-lww3 redis-3.0.6]$ ls
00-RELEASENOTES CONTRIBUTING deps Makefile README runtest
runtest-sentinel src utils
BUGS COPYING INSTALL MANIFESTO redis.conf runtest-cluster
sentinel.conf tests
[redis@aly-lww3 redis-3.0.6]$ make
LINK redis-check-aof
Hint: It's a good idea to run 'make test' ;)
make[1]: Leaving directory `/home/redis/redis-3.0.6/src'
[redis@aly-lww3 redis-3.0.6]$ make test
...
...
\o/ All tests passed without errors!
Cleanup: may take some time... OK
make[1]: Leaving directory `/home/redis/redis-3.0.6/src'
[redis@aly-lww3 redis-3.0.6]$
4.修改配置文件
[redis@aly-lww3 redis-3.0.6]$ vim /home/redis/redis-3.0.6/redis.conf
daemonize yes
pidfile /home/redis/redis-3.0.6/redis.pid
port 6379
bind 127.0.0.1
timeout 300
loglevel verbose
logfile "redis-3.0.6"
databases 16
save 900 1
save 300 10
save 60 10000
rdbcompression yes
dir ./
[redis@aly-lww3 redis-3.0.6]$ /home/redis/redis-3.0.6/src/redis-server
/home/redis/redis-3.0.6/redis.conf
[redis@aly-lww3 redis-3.0.6]$ cat /home/redis/redis-3.0.6/redis.log
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 3.0.6 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 23060
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io `-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
23060:M 31 Jan 22:20:40.538 # WARNING: The TCP backlog setting of 511 cannot be enforced
because /proc/sys/net/core/somaxconn is set to the lower value of 128.
23060:M 31 Jan 22:20:40.538 # Server started, Redis version 3.0.6
23060:M 31 Jan 22:20:40.538 # 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.
23060:M 31 Jan 22:20:40.538 * The server is now ready to accept connections on port 6379
23060:M 31 Jan 22:20:40.538 - 0 clients connected (0 slaves), 757352 bytes in use
...
[redis@aly-lww3 redis-3.0.6]$
[root@aly-lww3 ~]# vim /etc/sysctl.conf
vm.overcommit_memory = 1
[root@aly-lww3 ~]# sysctl -p
[root@aly-lww3 ~]# echo 0 > /proc/sys/vm/overcommit_memory
[root@aly-lww3 ~]# echo 80 > /proc/sys/vm/overcommit_ratio
用客户端连接测试:
[redis@aly-lww3 redis-3.0.6]$ /home/redis/redis-3.0.6/src/redis-cli -p 6379
127.0.0.1:6379> set username liweiwei
OK
127.0.0.1:6379> get username
"liweiwei"
127.0.0.1:6379> exit
[redis@aly-lww3 redis-3.0.6]$
本文出自 “bjx1101” 博客,请务必保留此出处http://lww2016.blog.51cto.com/3560553/1742364
[root@aly-lww3 ~]# yum -y install tcl
[root@aly-lww3 ~]# useradd redis
[root@aly-lww3 ~]# passwd redis
Changing password for user redis.
New password:
BAD PASSWORD: it is too short
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.
[root@aly-lww3 ~]#
2.下载安装包
[root@aly-lww3 ~]# su - redis
[redis@aly-lww3 ~]$ wget http://120.52.72.46/download.redis.io/c3pr90ntcsf0/releases/redis-3.0.6.tar.gz --2016-01-31 21:47:42-- http://120.52.72.46/download.redis.io/c3pr90ntcsf0/releases/redis-3.0.6.tar.gz Connecting to 120.52.72.46:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1372648 (1.3M) [application/x-gzip]
Saving to: “redis-3.0.6.tar.gz”
100%[==========================================================================
=================>] 1,372,648 12.5K/s in 1m 58s
2016-01-31 21:49:41 (11.3 KB/s) - “redis-3.0.6.tar.gz” saved [1372648/1372648]
3.解压安装
[redis@aly-lww3 ~]$ ll
total 1344
-rw-rw-r-- 1 redis redis 1372648 Dec 18 23:24 redis-3.0.6.tar.gz
[redis@aly-lww3 ~]$ tar -zxf redis-3.0.6.tar.gz
[redis@aly-lww3 ~]$ cd redis-3.0.6
[redis@aly-lww3 redis-3.0.6]$ ls
00-RELEASENOTES CONTRIBUTING deps Makefile README runtest
runtest-sentinel src utils
BUGS COPYING INSTALL MANIFESTO redis.conf runtest-cluster
sentinel.conf tests
[redis@aly-lww3 redis-3.0.6]$ make
LINK redis-check-aof
Hint: It's a good idea to run 'make test' ;)
make[1]: Leaving directory `/home/redis/redis-3.0.6/src'
[redis@aly-lww3 redis-3.0.6]$ make test
...
...
\o/ All tests passed without errors!
Cleanup: may take some time... OK
make[1]: Leaving directory `/home/redis/redis-3.0.6/src'
[redis@aly-lww3 redis-3.0.6]$
4.修改配置文件
[redis@aly-lww3 redis-3.0.6]$ vim /home/redis/redis-3.0.6/redis.conf
daemonize yes
pidfile /home/redis/redis-3.0.6/redis.pid
port 6379
bind 127.0.0.1
timeout 300
loglevel verbose
logfile "redis-3.0.6"
databases 16
save 900 1
save 300 10
save 60 10000
rdbcompression yes
dir ./
[redis@aly-lww3 redis-3.0.6]$ /home/redis/redis-3.0.6/src/redis-server
/home/redis/redis-3.0.6/redis.conf
[redis@aly-lww3 redis-3.0.6]$ cat /home/redis/redis-3.0.6/redis.log
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 3.0.6 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 23060
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io `-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
23060:M 31 Jan 22:20:40.538 # WARNING: The TCP backlog setting of 511 cannot be enforced
because /proc/sys/net/core/somaxconn is set to the lower value of 128.
23060:M 31 Jan 22:20:40.538 # Server started, Redis version 3.0.6
23060:M 31 Jan 22:20:40.538 # 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.
23060:M 31 Jan 22:20:40.538 * The server is now ready to accept connections on port 6379
23060:M 31 Jan 22:20:40.538 - 0 clients connected (0 slaves), 757352 bytes in use
...
[redis@aly-lww3 redis-3.0.6]$
[root@aly-lww3 ~]# vim /etc/sysctl.conf
vm.overcommit_memory = 1
[root@aly-lww3 ~]# sysctl -p
[root@aly-lww3 ~]# echo 0 > /proc/sys/vm/overcommit_memory
[root@aly-lww3 ~]# echo 80 > /proc/sys/vm/overcommit_ratio
用客户端连接测试:
[redis@aly-lww3 redis-3.0.6]$ /home/redis/redis-3.0.6/src/redis-cli -p 6379
127.0.0.1:6379> set username liweiwei
OK
127.0.0.1:6379> get username
"liweiwei"
127.0.0.1:6379> exit
[redis@aly-lww3 redis-3.0.6]$
本文出自 “bjx1101” 博客,请务必保留此出处http://lww2016.blog.51cto.com/3560553/1742364
相关文章推荐
- Redis学习笔记(4) Redis事务、生存时间及排序
- Redis应用场景
- 本地连接虚拟机的redis
- Redis总录
- linux下redis安装
- Redis命令大全&中文解释&在线测试命令工具&在线中文文档
- redis 安装 配置 启动
- Redis - Commands
- Redis入门知识
- redis练习手册<十三>Redis发布订阅
- Ubuntu 14.04下Redis安装及简单测试
- CentOS7 Magento 链接Redis提示:Connection to Redis failed after 2 failures
- PAODING-ROSE与Redis集成
- 深入理解Spring Redis的使用 (一)、Spring Redis基本使用
- redis练习手册<十二>zset主要操作函数小结
- Redis分区探究
- Redis 中文论坛推广
- redis 学习笔记(1)-编译、启动、停止
- redis密码管理
- redis编译安装:make 的新错误--collect2: ld returned 1 exit status