CentOS6.4 installation of Redis tutorial details

  • 2020-05-24 06:27:17
  • OfStack

Follow these steps in turn

1. Check dependencies and install dependencies


[root@ecs-3c46 ~]# whereis gcc
gcc: /usr/bin/gcc /usr/lib/gcc /usr/libexec/gcc /usr/share/man/man1/gcc.1.gz
[root@ecs-3c46 ~]# whereis tc
tc: /sbin/tc /usr/lib64/tc /usr/share/tc /usr/share/man/man8/tc.8.gz
[root@ecs-3c46 ~]# whereis wget
wget: /usr/bin/wget /usr/share/man/man1/wget.1.gz
[root@ecs-3c46 ~]# yum -y install tcl 

2. Enter/user/local src /


[root@ecs-3c46 ~]# cd /user/local/src/ 

3. Download redis wget


[root@ecs-3c46 src]# wget http://download.redis.io/releases/redis-3.0.7.tar.gz 

4. The decompression


[root@ecs-3c46 src]tar zxvf redis-3.0.7.tar.gz 

5. Transfer the file to /usr/local/redis


[root@ecs-3c46 src]mkdir /usr/local/redis
[root@ecs-3c46 src]mv redis-3.0.7 /usr/local/redis
[root@ecs-3c46 src]ll /usr/local/redis 

6. Compile and install


[root@ecs-3c46 src]cd /usr/local/redis
[root@ecs-3c46 redis]make && make install 

7. Create the redi folder in the etc directory and create the configuration file, and modify the configuration file


[root@ecs-3c46 redis]mkdir -p /etc/redis
[root@ecs-3c46 redis]pwd
[root@ecs-3c46 redis]cp -fr /usr/local/redis/redis.conf /etc/redis/ 

8. vim editor/etc redis/redis conf, modify for yes daemonize attribute


[root@ecs-3c46 redis]# vim /usr/local/redis/redis.conf
# By default Redis does not run as a daemon. Use 'yes' if you need it.
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
daemonize yes 

9. Perform/usr loal/bin/redis - server etc/redis/redis conf to start redis server


[root@ecs-3c46 redis]# /usr/loal/bin/redis-server /etc/redis/redis.conf
-bash: /usr/loal/bin/redis-server: No such file or directory
[root@ecs-3c46 redis]# /usr/local/bin/redis-server /etc/redis/redis.conf
73449:M 13 May 10:56:00.839 * Increased maximum number of open files to 10032 (it was originally set to 1024).

_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 3.0.7 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 73449
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'

10. Open another terminal, switch to the installation directory of redis and execute redis-cli


[root@ecs-3c46 bin]# redis-cli
127.0.0.1:6379> keys *
(empty list or set)
127.0.0.1:6379> 

The above is the site to give you CentOS6.4 installation Redis tutorial, I hope to help you!


Related articles: