MacOS:安装Redis与启用

一、概述

内存数据库,key-value存储系统,是当前比较热门的NOSQL系统之一。

二、homebrw安装

1.搜索redis

brew search redis

➜  ~ brew search redis
==> Formulae
hiredis                                  redis-leveldb
openresty/brew/redis-nginx-module        [email protected]
openresty/brew/redis2-nginx-module       [email protected]
redis

==> Casks
homebrew/cask/another-redis-desktop-manager
homebrew/cask/redis

2.安装

brew install redis

➜  ~ brew install redis

3.redis配置文件路径

/usr/local/etc/redis.conf

4.卸载redis

brew uninstall redis

三、服务管理

1.启动

brew services start redis

➜  ~ brew services start redis
==> Successfully started `redis` (label: homebrew.mxcl.redis)

2.查看服务

brew services list

➜  ~ brew services list
Name  Status  User Plist
nginx stopped
redis started chao /Users/chao/Library/LaunchAgents/homebrew.mxcl.redis.plist

3.关闭服务

brew services stop redis

➜  ~ brew services stop redis
Stopping `redis`... (might take a while)
==> Successfully stopped `redis` (label: homebrew.mxcl.redis)

4. 连接

redis-cli -h 127.0.0.1

➜  ~ redis-cli -h 127.0.0.1
127.0.0.1:6379> KEYS *
(empty list or set)
127.0.0.1:6379>

你可能感兴趣的:(macOS,Redis,redis,mac,redis)