最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【已解决】Mac中安装和运行redis

Mac crifan 4938浏览 0评论

折腾:

【已解决】运行Celery出错:consumer Cannot connect to redis Error 61

期间,需要去mac中安装和运行redis

mac中直接:

brew install redis

就好了?

还是去找找是否有要注意的

mac  install redis

在mac上通过Homebrew安装redis – CSDN博客

Install and config Redis on Mac OS X via Homebrew – Pete Houston – Medium

Mac环境下安装Redis – 简书

mac os 安装 redis – 简书

mac下安装配置redis – 简书

好像的确是的

mac下redis安装、设置、启动停止 – 漫夭 – 博客园

去安装:

<code>➜  server brew install redis
Updating Homebrew...
==&gt; Downloading https://homebrew.bintray.com/bottles/redis-4.0.9.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==&gt; Pouring redis-4.0.9.high_sierra.bottle.tar.gz
==&gt; Caveats
To have launchd start redis now and restart at login:
  brew services start redis
Or, if you don't want/need a background service you can just run:
  redis-server /usr/local/etc/redis.conf
==&gt; Summary
🍺  /usr/local/Cellar/redis/4.0.9: 13 files, 2.8MB
➜  server which redis
redis not found
➜  server which redis-cli
/usr/local/bin/redis-cli
➜  server which redis-server
/usr/local/bin/redis-server
➜  server redis-server --version
Redis server v=4.0.9 sha=00000000:0 malloc=libc bits=64 build=e0c8d37381c486c6
➜  server redis-cli --version
redis-cli 4.0.9
➜  server
</code>

然后直接去运行redis的server:

<code>➜  ~ redis-server
40538:C 11 May 17:49:50.859 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
40538:C 11 May 17:49:50.860 # Redis version=4.0.9, bits=64, commit=00000000, modified=0, pid=40538, just started
40538:C 11 May 17:49:50.860 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
40538:M 11 May 17:49:50.862 * Increased maximum number of open files to 10032 (it was originally set to 4864).
                _._
           _.-``__ ''-._
      _.-``    `.  `_.  ''-._           Redis 4.0.9 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 40538
  `-._    `-._  `-./  _.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |           http://redis.io
  `-._    `-._`-.__.-'_.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |
  `-._    `-._`-.__.-'_.-'    _.-'
      `-._    `-.__.-'    _.-'
          `-._        _.-'
              `-.__.-'

40538:M 11 May 17:49:50.864 # Server initialized
40538:M 11 May 17:49:50.864 * Ready to accept connections
</code>

再去看看redis的shell的效果:

<code>➜  ~ redis-cli
127.0.0.1:6379&gt; ping
PONG
127.0.0.1:6379&gt; KEYS
(error) ERR wrong number of arguments for 'keys' command
127.0.0.1:6379&gt; KEYS *
1) "unacked_mutex"
2) "_kombu.binding.celery"
3) "_kombu.binding.celery.pidbox"
4) "_kombu.binding.celeryev"
127.0.0.1:6379&gt; set tempId abc
OK
127.0.0.1:6379&gt; get tempId
"abc"
127.0.0.1:6379&gt;
</code>

是正常的。

【总结】

Mac中安装redis

<code>brew install redis
</code>

然后运行redis服务:

<code>redis-server
</code>

新开终端中去试试效果:

<code>redis-cli
</code>

转载请注明:在路上 » 【已解决】Mac中安装和运行redis

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
82 queries in 0.190 seconds, using 22.11MB memory