如果您使用homebrew安装redis,则可以看到软件包中的内容如下:
brew install redis
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
因此,其中很多是许可证,自述文件,并且在6个二进制文件中,无论如何都是一个符号链接。因此,这并不是一个繁重的安装,无论如何都带有大量的服务和配置文件。
顺便说一句,您始终可以在不安装任何东西的情况下拉动并运行Docker redis-cli
:
docker run -it redis redis-cli -h 192.168.0.8 # change to your Redis host's IP
如果您实际上只想安装尽可能多的软件,则实际上无需安装任何软件!Redis协议非常简单,因此您可以构建一个命令bash
并自己发送,如下所示:
#!/bin/bash
################################################################################
# redis.sh
# Very, very simplistic Redis client in bash
# Mark Setchell
# Usage:
# redis.sh SET answer 42
#
# Ref: https://redis.io/topics/mass-insert
################################################################################
if [ $# -lt 2 ] ; then
echo "Usage: redis.sh SET answer 42" >&2
exit 1
fi
# Build protocol string
protocol="*$#\r\n"
for var in "$@" ; do
protocol+="$"
protocol+="${#var}\r\n${var}\r\n"
done
# Send to Redis on default port on local host - but you can change it
printf "$protocol" > /dev/tcp/localhost/6379
关键字:Redis,redis-cli,docker,最小,纯bash。
brew install redis
仅按原样安装6个文件-其中一个是符号链接!