diff --git a/README.md b/README.md index 83fdac75ec68de719d7f79aee813121bc1ffc9aa..57194346c4294021a606f25c8fb86f238ca00018 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,8 @@ [CentOS 8 下安装 Nginx](软件安装手册/中间件安装/CentOS8下安装Nginx.md) + [CentOS 8 下安装 Redis](软件安装手册/中间件安装/CentOS8下安装Redis.md) + 3. 数据库安装 [CentOS 8 下安装 MySQL](软件安装手册/数据库安装/CentOS8下MySQL安装手册.md) \ No newline at end of file diff --git "a/\350\275\257\344\273\266\345\256\211\350\243\205\346\211\213\345\206\214/\344\270\255\351\227\264\344\273\266\345\256\211\350\243\205/CentOS8\344\270\213\345\256\211\350\243\205Redis.md" "b/\350\275\257\344\273\266\345\256\211\350\243\205\346\211\213\345\206\214/\344\270\255\351\227\264\344\273\266\345\256\211\350\243\205/CentOS8\344\270\213\345\256\211\350\243\205Redis.md" new file mode 100644 index 0000000000000000000000000000000000000000..b6c55d26344de410a19ca11502ee2adf1db752d6 --- /dev/null +++ "b/\350\275\257\344\273\266\345\256\211\350\243\205\346\211\213\345\206\214/\344\270\255\351\227\264\344\273\266\345\256\211\350\243\205/CentOS8\344\270\213\345\256\211\350\243\205Redis.md" @@ -0,0 +1,44 @@ +#### DNF安装Redis + +1. 查询 Redis 版本 + + ```shell + [root@localhost ~]# dnf list redis + ``` + +2. 安装 Redis + + ~~~shell + [root@localhost ~]# dnf install redis + ~~~ + +3. 查看 Redis 相关文件位置 + + ~~~shell + [root@localhost ~]# rpm -ql redis + ~~~ + + - 配置文件位置:*/etc* 下,***redis-sentinel.conf*** 文件以及 ***redis.conf*** 文件。 + - 运行脚本位置:*/usr/bin/* 下,***redis-benchmark***(自带的Redis性能测试工具),***redis-check-aof***,***redis-check-rdb***,***redis-cli***,***redis-sentinel***(哨兵启动脚本),***redis-server***。 + - 默认日志目录:*/var/log/redis/*,默认为此目录下的 ***redis.log*** 文件。 + +4. Redis 基本命令 + + ```shell + [root@localhost ~]# redis-server 启动Redis,非后台启动,退出命令行后服务停止 + [root@localhost ~]# redis-server & 后台启动启动Redis + [root@localhost redis]# redis-cli 进入Redis客户端 + 127.0.0.1:6379> ping + PONG + 127.0.0.1:6379> exit + [root@localhost redis]# redis-cli shutdown 关闭Redis服务 + 2836:M 14 Sep 2020 01:04:13.294 # User requested shutdown... + 2836:M 14 Sep 2020 01:04:13.294 * Saving the final RDB snapshot before exiting. + 2836:M 14 Sep 2020 01:04:13.295 * DB saved on disk + 2836:M 14 Sep 2020 01:04:13.296 # Redis is now ready to exit, bye bye... + [1]+ 已完成 redis-server (工作目录: /var/lib) + (当前工作目录:/var/log/redis) + ``` + + +