[Redis] Installation and Configuration

A, Redis stand-alone installation

  • C language-dependent installation

redis使用C语言编写,所以需要安装C语言库

# yum install -y gcc-c++ automake autoconf libtool make tcl 
  • Upload and unzip

    把redis-5.0.5.tar.gz上传到/usr/local/tmp中

unzip files

# cd /usr/local/tmp
# tar zxf redis-5.0.5.tar.gz 
  • Compile and install

Extract the folder into the

# cd /usr/local/tmp/redis-5.0.5/

Compile

# make

installation

# make install PREFIX=/usr/local/redis
  • Open daemon

    复制/usr/local/tmp/redis-5.0.5/中redis.conf配置文件

# cp /usr/local/tmp/redis-5.0.5/redis.conf /usr/local/redis/bin/

修改配置文件

# cd /usr/local/redis/bin/
# vim redis.conf

把daemonize的值由no修改为yes

img

  • Modify external access

Redis5 need to modify the configuration file in the redis.confexternal access. We need to change two things.

Comment out the following

bind 127.0.0.1

img

protected-mode yes 改成 no

img

  • Start and test

    1. Start redis

# ./redis-server redis.conf
 2.启动客户端工具
#./redis-cli 

 3.重启redis
# ./redis-cli shutdown
# ./redis-server redis.conf

4. Test

image-20191219204021367

Guess you like

Origin www.cnblogs.com/meiqiu-yw/p/12070122.html