Ali cloud centos7.5 install redis

1. Obtain redis website http://download.redis.io/releases/

wget http://download.redis.io/releases/redis-4.0.14.tar.gz

2. Extract

tar zxvf redis-4.0.14.tar.gz

3. Switch to redis-4.0.14

cd redis-4.0.14

4. Installation, specify the installation path / usr / local / redis

make
make PREFIX=/usr/local/redis install

5. arranged to copy the install directory redis.conf

cp redis.conf /usr/local/redis

cd /usr/local/redis

6. Edit redis.conf

vim redis.conf

# Some simple configuration is as follows: Ï
# backstage start
daemonize yes
# Bind port, port 6379 is the default security groups need to open port 6379
Port 6379
# Bind IP, the default is 127.0.0.1, if you want to remotely can link Redis, instead 0.0.0.0
the bind 0.0.0.0
# specify the data storage path, rdb storage path
dir / usr / local / Redis / log
# specify persistent way
appendOnly yes
# password
requirepass 123456

Start the client and server

1. Start redis server, and specify the configuration file

./bin/redis-server ./redis.conf

If you can not find the log / path, create a log file folder
mkdir log

See if started successfully:

ps aux | grep redis

2. Start redis client

./bin/redis-cli

If (error) NOAUTH Authentication required solution appears

Enter the password to solve auth 123456 (123456 is redis password)
127.0.0.1:6379> the SET MyKey lisi
(error) NOAUTH Authentication required.
127.0.0.1:6379> auth redis
the OK

3. Close redis process

kill -9 22276 or killall redis-server

Released four original articles · won praise 2 · Views 184

Guess you like

Origin blog.csdn.net/OuYz12/article/details/105071128