[root@wallet01 ~]# wget http://rpms.remirepo.net/enterprise/remi-release-6.rpm
[root@wallet01 ~]# rpm -ivh remi-release-6.rpm
[root@wallet01 ~]# yum --enablerepo=remi install redis
[root@wallet01 ~]# vi /etc/redis.conf
bind 192.168.40.34
port 6379
daemonize yes
pidfile /var/run/redis_6379.pid
logfile /var/log/redis/redis.log
dir /var/lib/redis
appendonly yes
[root@wallet01 ~]# vi /etc/sysctl.conf
net.core.somaxconn = 511
vm.overcommit_memory = 1
[root@wallet01 ~]# sysctl -p
[root@wallet01 ~]# service redis start
Starting redis-server: [ OK ]
[root@wallet01 ~]# service redis status
redis-server (pid 3113) is running...
[root@wallet01 ~]# netstat -tunlp | grep redis
tcp 0 0 192.168.40.34:6379 0.0.0.0:* LISTEN 3113/redis-server 1
[root@wallet01 ~]# cat /var/log/redis/redis.log
3112:C 22 May 2019 11:59:36.413 # Redis version=5.0.5, bits=64, commit=00000000, modified=0, pid=3113, just started
3112:C 22 May 2019 11:59:36.413 # Configuration loaded
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 5.0.5 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 3113
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
3113:M 22 May 2019 11:59:36.417 # Server initialized
3113:M 22 May 2019 11:59:36.417 * DB loaded from disk: 0.000 seconds
3113:M 22 May 2019 11:59:36.417 * Ready to accept connections
转载于:https://blog.51cto.com/13598811/2083541