您的位置:首页 > 数据库 > Redis

mac 安装redis

2016-07-22 00:00 573 查看
摘要: mac 安装redis

切换到su管理下面

sudo su

一、make MALLOC=jemalloc(如果是linux = make MALLOC=libc )

make MALLOC=jemalloc

二、make install

sh-3.2# make install
cd src && /Library/Developer/CommandLineTools/usr/bin/make install

Hint: It's a good idea to run 'make test' ;)

INSTALL install
INSTALL install
INSTALL install
INSTALL install
INSTALL install

三、在/usr/local/bin/下面启动redis

➜  redis-3.2.1 cd /usr/local/bin
➜  bin git:(master) ls
brew            node            redis-benchmark redis-check-rdb redis-sentinel  thrift
idea            npm             redis-check-aof redis-cli       redis-server    wget
➜  bin git:(master) ./redis-server start
11679:C 22 Jul 15:09:52.774 # Fatal error, can't open config file 'start'
➜  bin git:(master) ./redis-server
11688:C 22 Jul 15:09:58.033 # Warning: no config file specified, using the default config. In order to specify a config file use ./redis-server /path/to/redis.conf
11688:M 22 Jul 15:09:58.035 * Increased maximum number of open files to 10032 (it was originally set to 4864).
_._
_.-``__ ''-._
_.-``    `.  `_.  ''-._           Redis 3.2.1 (00000000/0) 64 bit
.-`` .-```.  ```\/    _.,_ ''-._
(    '      ,       .-`  | `,    )     Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
|    `-._   `._    /     _.-'    |     PID: 11688
`-._    `-._  `-./  _.-'    _.-'
|`-._`-._    `-.__.-'    _.-'_.-'|
|    `-._`-._        _.-'_.-'    |           http://redis.io `-._    `-._`-.__.-'_.-'    _.-'
|`-._`-._    `-.__.-'    _.-'_.-'|
|    `-._`-._        _.-'_.-'    |
`-._    `-._`-.__.-'_.-'    _.-'
`-._    `-.__.-'    _.-'
`-._        _.-'
`-.__.-'

11688:M 22 Jul 15:09:58.036 # Server started, Redis version 3.2.1
11688:M 22 Jul 15:09:58.036 * The server is now ready to accept connections on port 6379

启动建议在su用户下面,我这边关闭redis的时候关闭不了,出现权限的问题。如果关闭不了,使用top命令找到进程id ,然后kill -9 redis的pid

在su下面按control+c 可以正常关闭。

12127:M 22 Jul 15:51:19.269 # Server started, Redis version 3.2.1
12127:M 22 Jul 15:51:19.270 * The server is now ready to accept connections on port 6379
^C12127:signal-handler (1469173881) Received SIGINT scheduling shutdown...
12127:M 22 Jul 15:51:21.433 # User requested shutdown...
12127:M 22 Jul 15:51:21.433 * Saving the final RDB snapshot before exiting.
12127:M 22 Jul 15:51:21.435 * DB saved on disk
12127:M 22 Jul 15:51:21.436 # Redis is now ready to exit, bye bye...
sh-3.2#
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: