linux下安装redis

1.安装gcc

yum install -y gcc-c++

2.下载安装包

wget https://download.redis.io/releases/redis-6.2.0.tar.gz

3.解压

tar -zxvf redis-6.2.0.tar.gz

4.编译安装

cd redis-6.2.0

make

##/home/redis为安装目录##
make install PREFIX=/home/redis

5.拷贝配置文件并授权

mkdir -p /home/redis/conf

cd redis-6.2.0
cp redis.conf /home/redis/conf
cp sentinel.conf /home/redis/conf

cd /home/redis/conf
chmod 777 redis.conf
chmod 777 sentinel.conf 

6.修改配置文件

vi /home/redis/conf/redis.conf
bind 0.0.0.0

daemonize yes

7.启动redis

cd /home/redis

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

8.使用连接工具连接redis

posted @ 2023-05-01 10:17  linmt  阅读(275)  评论(0编辑  收藏  举报