Redis安装
Windows安装
-
下载Windows压缩包 https://github.com/microsoftarchive/redis/releases
-
解压到环境目录下:
D:\Environment\Redis-x64-3.0.504
-
运行服务(redis-server.exe)
-
启动redis客户端
Linux安装
-
官网下载源码压缩包
-
解压并安装redis
[root@haloblog ~]# tar zxvf redis-7.0.5.tar.gz [root@haloblog ~]# cd redis-7.0.5/ [root@haloblog redis-7.0.5]# make
redis源码目录下的文件:
-
redis的安装路径:
/use/local/bin
-
配置文件路径设置:
/usr/local/bin/redis-config
(需要注意redis-config目录是我们自己创建的)# 将源码中的配置文件拷贝到自己创建的目录下,后续就在拷贝后配置文件上修改配置 cp /root/redis-7.0.5/redis.conf redis-config/
-
修改配置文件,设置redis-server默认后台运行
vim redis-config/redis.conf
守护进程模式启动!!
-
启动redis-server
#redis-server 配置文件路径 redis-server redis-config/redis.conf # 查看服务是否启动 netstat -tanp | grep redis
-
启动redis-cli,连接redis-server
-
关闭redis服务
客户端执行:
shutdown
查看进程是否结束:
ps -ef | grep redis