1
2
| [root@iZuf6gk461dc7xwwmsrakfZ ~]# cd /usr/local/
[root@iZuf6gk461dc7xwwmsrakfZ local]# wget http://download.redis.io/releases/redis-4.0.6.tar.gz
|
1
| [root@iZuf6gk461dc7xwwmsrakfZ local]# tar -zxvf redis-4.0.6.tar.gz
|
1
| [root@iZuf6gk461dc7xwwmsrakfZ local]# yum install gcc
|
1
2
3
| [root@iZuf6gk461dc7xwwmsrakfZ local]# cd redis-4.0.6
[root@iZuf6gk461dc7xwwmsrakfZ redis-4.0.6]# make MALLOC=libc
[root@iZuf6gk461dc7xwwmsrakfZ redis-4.0.6]# cd src && make install
|
1
2
| [root@iZuf6gk461dc7xwwmsrakfZ redis-4.0.6]# cd src/
[root@iZuf6gk461dc7xwwmsrakfZ src]# ./redis-server
|
1
2
3
4
5
| [root@iZuf6gk461dc7xwwmsrakfZ src]# vim ../redis.conf
From 'daemonize no' to 'daemonize yes'
[root@iZuf6gk461dc7xwwmsrakfZ src]# ./redis-server /usr/local/redis-4.0.6/redis.conf
|
1
2
| [root@iZuf6gk461dc7xwwmsrakfZ src]# ps -aux | grep redis
[root@iZuf6gk461dc7xwwmsrakfZ src]# kill -9 16850
|
1
2
3
4
5
6
7
8
9
10
11
12
13
| [root@iZuf6gk461dc7xwwmsrakfZ src]# mkdir /etc/redis
[root@iZuf6gk461dc7xwwmsrakfZ src]# cp /usr/local/redis-4.0.6/redis.conf /etc/redis/6379.conf
[root@iZuf6gk461dc7xwwmsrakfZ src]# cp /usr/local/redis-4.0.6/utils/redis_init_script /etc/init.d/redisd
[root@iZuf6gk461dc7xwwmsrakfZ src]# vim /etc/init.d/redisd
#!/bin/sh
# chkconfig: 2345 90 10
# description: Redis is a persistent key-value database
[root@iZuf6gk461dc7xwwmsrakfZ src]# chkconfig redisd on
[root@iZuf6gk461dc7xwwmsrakfZ src]# service redisd start
[root@iZuf6gk461dc7xwwmsrakfZ src]# service redisd stop
|