==> Downloading http://download.redis.io/releases/redis-3.2.3.tar.gz ######################################################################## 100.0% ==> make install PREFIX=/usr/local/Cellar/redis/3.2.3 CC=clang ==> 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 ==> Summary 🍺 /usr/local/Cellar/redis/3.2.3: 10 files, 1.7M, built in 21 seconds
################################# GENERAL #####################################
# By default Redis does not run as a daemon. Use 'yes' if you need it. # Note that Redis will write a pid file in /usr/local/var/run/redis.pid when daemonized. daemonize no
supervised no pidfile /var/run/redis_6379.pid loglevel notice logfile ""
# Set the number of databases. The default database is DB 0, you can select # a different one on a per-connection basis using SELECT <dbid> where # dbid is a number between 0 and 'databases'-1 databases 16
Redis is able to start without a configuration file using a built-in default configuration, however this setup is only recommended for testing and development purposes. The proper way to configure Redis is by providing a Redis configuration file, usually called redis.conf.
8568:M 11 Sep 21:37:46.839 * Increased maximum number of open files to 10032 (it was originally set to 256). _._ _.-``__ ''-._ _.-`` `. `_. ''-._ Redis 3.2.3 (00000000/0) 64 bit .-`` .-```. ```\/ _.,_ ''-._ ( ' , .-` | `, ) Running in standalone mode |`-._`-...-` __...-.``-._|'` _.-'| Port: 6379 | `-._ `._ / _.-' | PID: 8568 `-._ `-._ `-./ _.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | http://redis.io `-._ `-._`-.__.-'_.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | `-._ `-._`-.__.-'_.-' _.-' `-._ `-.__.-' _.-' `-._ _.-' `-.__.-'
8568:M 11 Sep 21:37:46.844 # Server started, Redis version 3.2.3 8568:M 11 Sep 21:37:46.845 * The server is now ready to accept connections on port 6379
8773:M 11 Sep 21:46:26.581 # User requested shutdown... 8773:M 11 Sep 21:46:26.581 * Saving the final RDB snapshot before exiting. 8773:M 11 Sep 21:46:26.583 * DB saved on disk 8773:M 11 Sep 21:46:26.583 * Removing the pid file. 8773:M 11 Sep 21:46:26.583 # Redis is now ready to exit, bye bye...
然后在另外一个终端窗口执行$ redis-cli ping,输出
1
Could not connect to Redis at 127.0.0.1:6379: Connection refused
说明确实已关闭
方法2 在另外一个终端窗口执行$ redis-cli shutdown,此时第一个窗口输出
1 2 3 4 5
8773:M 11 Sep 21:46:26.581 # User requested shutdown... 8773:M 11 Sep 21:46:26.581 * Saving the final RDB snapshot before exiting. 8773:M 11 Sep 21:46:26.583 * DB saved on disk 8773:M 11 Sep 21:46:26.583 * Removing the pid file. 8773:M 11 Sep 21:46:26.583 # Redis is now ready to exit, bye bye...
然后在另外一个终端窗口执行$ redis-cli ping,输出
1
Could not connect to Redis at 127.0.0.1:6379: Connection refused