Centos安装配置Redis4-AOF持久化
(1)安装基础依赖包
sudo yum install -y gcc gcc-c++ make jemalloc-devel epel-release tcl
(2)从官网下载
wget <http://download.redis.io/releases/redis-4.0.2.tar.gz>
(3)解压到目录
#创建目录
sudo mkdir /usr/redis
#解压
sudo tar -zvxf redis-4.0.2.tar.gz -C /usr/redis
(4)编译安装
#进入目录
cd /usr/redis/redis-4.0.2
#编译&安装
sudo make & make install
(5)修改配置
vim /usr/redis/redis-4.0.2/redis.conf
# 修改为后台启动
daemonize yes
# 开启AOF存储
appendonly yes
# 设置连接密码
requirepass 4dstc.com
# 允许远程连接,改为no
protected-mode no
bind 0.0.0.0
(6)启动redis
./redis-server ../redis.conf
./redis-cli -h xxx -p xxx -a xxx