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#

 

转载于:https://my.oschina.net/jywm/blog/716229

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值