linux安装Redis_linux

1.下载


linux安装Redis_redis_02


注:要先安装c/c++环境!!!


yum -y install gcc gcc-c++ autoconf pcre pcre-devel make automake

2.解压

解压安装包,会在目录下生成一个文件夹。

tar zxvf redis-5.0.7.tar.gz

3.编译

然后进入解压后的文件夹编译。

make


切记,要先安装c++环境!!


4.修改配置文件redis.conf

这里主要修改三个部分。

bind 0.0.0.0        #将改行注释
daemonize yes #将后台运行设为yes
protected-mode yes #将安全模式设为yes
requirepass 123456 #设置密码

5.运行

 cd src ./redis-server  ../redis.conf

linux安装Redis_c++_03

6.验证

为启动起来了,可以用 ,查看是否启动。

ps axu | grep redis

7.停止

./redis-cli shutdown