美文网首页
macOS 安装启动 Redis6

macOS 安装启动 Redis6

作者: 一滴矿泉水 | 来源:发表于2023-07-02 11:59 被阅读0次

redis是一个key-value存储系统。和Memcached类似,它支持存储的value类型相对更多,包括string(字符串)、list(链表)、set(集合)和zset(有序集合)。这些数据类型都支持push/pop、add/remove及取交集并集和差集及更丰富的操作,而且这些操作都是原子性的。在此基础上,redis支持各种不同方式的排序。与memcached一样,为了保证效率,数据都是缓存在内存中。区别的是redis会周期性的把更新的数据写入磁盘或者把修改操作写入追加的记录文件,并且在此基础上实现了master-slave(主从)同步。

Redis 是一个高性能的key-value数据库。 redis的出现,很大程度补偿了memcached这类keyvalue存储的不足,在部 分场合可以对关系数据库起到很好的补充作用。它提供了Python,Ruby,Erlang,PHP客户端,使用很方便。[1]

redis 安装 与 启动

1、下载安装

进入官网,选择相应系统的压缩包。(此处以macOS 为例)

截屏2023-07-03 上午11.36.17.png

2、解压


截屏2023-07-03 上午11.42.13.png
  1. 启动 redis

打开终端 cd 进入 bin 目录下执行以下命令:

./redis-server

执行结果:

zhanghua@Breeze bin % ./redis-server
6973:C 03 Jul 2023 11:28:34.453 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
6973:C 03 Jul 2023 11:28:34.453 # Redis version=6.2.12, bits=64, commit=2d4b9401, modified=0, pid=6973, just started
6973:C 03 Jul 2023 11:28:34.453 # Warning: no config file specified, using the default config. In order to specify a config file use ./redis-server /path/to/redis.conf
6973:M 03 Jul 2023 11:28:34.453 * Increased maximum number of open files to 10032 (it was originally set to 2560).
6973:M 03 Jul 2023 11:28:34.454 * monotonic clock: POSIX clock_gettime
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 6.2.12 (2d4b9401/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                  
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 6973
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           https://redis.io       
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               

6973:M 03 Jul 2023 11:28:34.455 # Server initialized
6973:M 03 Jul 2023 11:28:34.455 * Ready to accept connections

至此本地 redis 已经启动成功 !

  1. 关闭 redis

bin 目录下执行以下命令:

zhanghua@Breeze bin % redis-cli shutdown

执行结果:

7432:M 03 Jul 2023 11:50:52.820 * DB loaded from disk: 0.001 seconds
7432:M 03 Jul 2023 11:50:52.820 * Ready to accept connections
7432:M 03 Jul 2023 11:58:11.049 # User requested shutdown...
7432:M 03 Jul 2023 11:58:11.049 * Saving the final RDB snapshot before exiting.
7432:M 03 Jul 2023 11:58:11.050 * DB saved on disk
7432:M 03 Jul 2023 11:58:11.050 # Redis is now ready to exit, bye bye...
zhanghua@Breeze bin % 

redis 客户端查看

1、MacOS 安装 Redis 客户端 Another-Redis-Desktop-Manager

终端执行以下命令,安装客户端:

brew install --cask another-redis-desktop-manager

接下来连接 Redis (必须保证 Redis 服务处于开启状态)。

截屏2023-07-03 上午11.49.29.png

点击确定,查看配置 。

截屏2023-07-03 上午11.51.55.png

文章持续更新中、希望对各位有所帮助、有问题可留言 大家共同学习!

相关文章

网友评论

      本文标题:macOS 安装启动 Redis6

      本文链接:https://www.haomeiwen.com/subject/pfdfudtx.html