centos8 安装redis
我没有虚拟机,此处使用docker安装centos8镜像,进行模拟
docker run -it centos:centos8 bash
centos8中安装编译器
yum install wget
# 安装编译器
yum install gcc-c++
yum -y install gcc automake autoconf libtool make
进入
Redis
官网
拷贝图中的连接地址
下载
Redis
cd /
mkdir /opt/
cd /opt
wget https://download.redis.io/releases/redis-6.2.6.tar.gz
解压,安装
# 解压
tar -xzvf redis-6.2.6.tar.gz
# 编译
cd /opt/redis-6.2.6
make
# 安装
make install
拷贝配置文件
# redis 默认安装路径 /usr/local/bin
mkdir /usr/local/bin/marionconfig
cp redis.conf /usr/local/bin/marionconfig/
启动
Redis
服务[root@a3052a608abe bin]# redis-server marionconfig/redis.conf
验证
[root@a3052a608abe bin]# redis-cli -h 127.0.0.1 -p 6379
127.0.0.1:6379> set name marion
OK
127.0.0.1:6379> get name
"marion"
127.0.0.1:6379>