[root@xulei.com ~]# yum install http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
[root@xulei.com ~]# yum --enablerepo=remi install redis
[root@xulei.com ~]# systemctl enable redis
允许远程登录: bind 127.0.0.1 改为 bind 0.0.0.0 (可选)
[root@xulei.com ~]# vim /etc/redis.conf
[root@xulei.com ~]# wget http://download.redis.io/releases/redis-5.0.5.tar.gz
[root@xulei.com ~]# tar -zxvf redis-5.0.5.tar.gz -C /usr/local
[root@xulei.com ~]# yum install gcc -y # gcc -v查看,如果没有需要安装
[root@xulei.com ~]# cd /usr/local/redis-5.0.5
[root@xulei.com redis-5.0.5]# make MALLOC=lib
[root@xulei.com redis-5.0.5]# cd src && make all
[root@xulei.com src]# make install
[root@xulei.com src]# ./redis-server
21522:C 17 Jun 2019 15:36:52.038 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
21522:C 17 Jun 2019 15:36:52.038 # Redis version=5.0.5, bits=64, commit=00000000, modified=0, pid=21522, just started
21522:C 17 Jun 2019 15:36:52.038 # Warning: no config file specified, using the default config. In order to specify a config file use ./redis-server /path/to/redis.conf
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 5.0.5 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 21522
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
出现以上界面说明安装成功
[root@xulei.com src]# ./redis-cli --version # 查询是安装的最新版本的redis
redis-cli 5.0.5
[root@xulei.com src]# ./redis-server --version
Redis server v=5.0.5 sha=00000000:0 malloc=libc bits=64 build=4db47e2324dd3c5
# 以./redis-server 启动方式,需要一直打开窗口,不能进行其他操作,不太方便,以后台进程方式启动 redis
[root@xulei.com src]# vim /usr/local/redis-5.0.5/redis.conf # 默认安装好的配置文件并不在这个目录下,需要找到复制到该目录下
daemonize no 改为 daemonize yes # 以守护进程运行
[root@xulei.com src]# ./redis-server /usr/local/redis-5.0.5/redis.conf
21845:C 17 Jun 2019 15:44:14.129 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
21845:C 17 Jun 2019 15:44:14.129 # Redis version=5.0.5, bits=64, commit=00000000, modified=0, pid=21845, just started
21845:C 17 Jun 2019 15:44:14.129 # Configuration loaded
[root@xulei.com src]# ps -ef|grep redis
root 21846 1 0 15:44 ? 00:00:00 ./redis-server 127.0.0.1:6379
root 22042 6950 0 15:46 pts/1 00:00:00 grep --color=auto redis
[root@xulei.com src]# kill -9 21846
# 此方法启动关闭较为麻烦,且不能设置开机自启动
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。