关于redis:CentOS-7环境安装redis及简单使用

9次阅读

共计 506 个字符,预计需要花费 2 分钟才能阅读完成。

1、装置 wget

yum -y install wget

2、/opt 门路下下载 redis

wget http://download.redis.io/releases/redis-6.2.1.tar.gz

3、装置 gcc

yum install gcc
gcc --version

4、解压 redis 包

tar -zxvf redis-6.2.1.tar.gz

5、cd redis-6.2.1/ 下,执行 make 编译成 C

6、执行 make install,装置实现

7、默认装置地位

/usr/local/bin

8、根本应用(配置后盾启动)

/opt/redis-6.2.1/redis.conf

复制配置文件
cp redis.conf /etc/redis.conf

编辑 /etc/redis.conf    
daemonize no 批改为 yes

启动
cd /usr/local/bin
./redis-server /etc/redis.conf

查看 redis 状态
ps -ef|grep redis

通过客户端连贯 redis
./redis-cli
127.0.0.1:6379> ping 打印 pong 示意联通状态失常 

敞开
127.0.0.1:6379> shutdown 
或
kill -9 < 过程号 >
正文完
 0