Mac(os x):有没有办法只安装redis-cli?

时间:2016-09-26 13:31:10

标签: macos redis

我试图运行brew install redis-cli并用Google搜索,但一无所获。有什么想法吗?

5 个答案:

答案 0 :(得分:35)

如果你跑:

brew ls redis

你会发现它确实只安装了很少的文件:

/usr/local/Cellar/redis/3.2.3/bin/redis-benchmark
/usr/local/Cellar/redis/3.2.3/bin/redis-check-aof
/usr/local/Cellar/redis/3.2.3/bin/redis-check-rdb
/usr/local/Cellar/redis/3.2.3/bin/redis-cli
/usr/local/Cellar/redis/3.2.3/bin/redis-sentinel
/usr/local/Cellar/redis/3.2.3/bin/redis-server
/usr/local/Cellar/redis/3.2.3/homebrew.mxcl.redis.plist

或者,您可以直接查看homebrew的酒窖,如下:

ls -lR /usr/local/Cellar/redis/3.2.3
total 40
-rw-r--r--  1 mark  admin  1487  2 Aug 10:00 COPYING
-rw-r--r--  1 mark  admin   376  9 Aug 10:34 INSTALL_RECEIPT.json
-rw-r--r--  1 mark  admin  6834  2 Aug 10:00 README.md
drwxr-xr-x  8 mark  admin   272  2 Aug 10:00 bin
-rw-r--r--  1 mark  admin   785  9 Aug 10:34 homebrew.mxcl.redis.plist

/usr/local/Cellar/redis/3.2.3/bin:
total 3440
-r-xr-xr-x  1 mark  admin   67668  2 Aug 10:00 redis-benchmark
-r-xr-xr-x  1 mark  admin   13936  2 Aug 10:00 redis-check-aof
-r-xr-xr-x  1 mark  admin  768704  2 Aug 10:00 redis-check-rdb
-r-xr-xr-x  1 mark  admin  129712  2 Aug 10:00 redis-cli
lrwxr-xr-x  1 mark  admin      12  2 Aug 10:00 redis-sentinel -> redis-server
-r-xr-xr-x  1 mark  admin  768704  2 Aug 10:00 redis-server

所以,很多是许可证,README和6个二进制文件,无论如何,一个是符号链接。因此,无论如何,它都不是一个包含大量服务和配置文件的重量级安装。

答案 1 :(得分:4)

Tgis不是redis-cli的正确安装,但是我可以完成我的工作。 我使用npm使其正常工作,我安装了redis-cli一个JavaScript库。

$ npm install -g redis-cli                  
    /Users/toni/.nvm/versions/node/v8.9.4/bin/rdcli -> /Users/toni/.nvm/versions/node/v8.9.4/lib/node_modules/redis-cli/bin/rdcli
    + redis-cli@1.3.0
    updated 1 package in 1.07s

然后使用控制台:

$ rdcli                                 
127.0.0.1:6379> keys incident::sequence
1) incident::sequence
127.0.0.1:6379> GET incident::sequence
570
127.0.0.1:6379> config get dir
1) dir
2) /data
127.0.0.1:6379> exit

答案 2 :(得分:4)

brew tap ringohub/redis-cli

brew update && brew doctor

brew install redis-cli

答案 3 :(得分:2)

我安装了redis-cli nodejs模块:

yarn global add redis-cli

然后运行redis客户端:

rdcli

与redis客户端连接,redis REPL shell已激活

答案 4 :(得分:0)

要开始Redis:

brew services start redis

启动redis-cli:

cd /usr/local/Cellar/redis/5.0.7/bin

./redis-cli