下载、解压、重命名并且编译安装Redis
~ wget http://download.redis.io/releases/redis-3.2.9.tar.gz
~ tar xzf redis-3.2.9.tar.gz
~ mv redis-3.2.9 redis
~ cd redis
~ make
~ make test
~ make install
配置文件redis.conf
redis解压目录里有一个配置文件redis.conf ,编辑此配置文件,找到 dir ./ 这一行[247行]。redis会将内存中的数据写入文件中,而此配置就是指定数据文件保存的路径。
我本机指定的目录:
dir ./
修改为
dir /Users/houxiurong/Software/redis_data/
编辑过后,将配置文件移动到 /usr/local/etc 目录下
~ sudo mv redis.conf /usr/local/etc/
启动Redis
终端输入:
~ /usr/local/bin/redis-server /usr/local/etc/redis.conf
服务启动成功画面:
houxiurong-MacBook-Pro:src houxiurong$ /usr/local/bin/redis-server /usr/local/etc/redis.conf
6508:M 01 Jul 18:21:33.662 * Increased maximum number of open files to 10032 (it was originally set to 256).
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 3.2.9 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 6508
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'

6508:M 01 Jul 18:21:33.664 # Server started, Redis version 3.2.9
6508:M 01 Jul 18:21:33.664 * DB loaded from disk: 0.000 seconds
6508:M 01 Jul 18:21:33.664 * The server is now ready to accept connections on port 6379

测试连通性
~ cd /usr/local/bin
~ ./redis-cli
127.0.0.1:6379> set me houxiurong
OK
127.0.0.1:6379> get me
"houxiurong"
设置开机自动启动redis server
新建plist文件
~ sudo vi /Library/LaunchDaemons/io.redis.redis-server.plist
文件内容如下
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>io.redis.redis-server</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/redis-server</string>
<string>/usr/local/etc/redis.conf</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
使用launchctl设置开机自动启动
~ sudo launchctl load /Library/LaunchDaemons/io.redis.redis-server.plist
使用launchctl启动redis server
~ sudo launchctl start io.redis.redis-server
使用launchctl停止redis server
~ sudo launchctl stop io.redis.redis-server

mac os x install redis-3.2.9的更多相关文章

  1. Mysql On Mac OS: Remove & Install

    If you downloaded and installed from .dmg package already, and mightbe sometime it sucks because of ...

  2. Mac OS X安装Redis

    http://my.oschina.net/jackieyeah/blog/524583

  3. mac os x在PC上安装

    系统安装之前的准备工作及安装过程简介 前面我们已经提到,苹果电脑虽然已经采用了x86架构的Intel处理器,但其官方并不提供在非苹果电脑上安装Mac OS的支持.所以,要想在普通PC/笔记本电脑上安装 ...

  4. Installing Apache, PHP, and MySQL on Mac OS X

    I have installed Apache, PHP, and MySQL on Mac OS X since Leopard. Each time doing so by hand. Each ...

  5. mac OS X下安装Redis及Thinkphp3.1使用Redis

    一.安装Redis 1.安装Homebrew 在终端输入ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/install/maste ...

  6. mac brew install redis 报错

    mac brew install redis 报错 /usr/local/opt/php55/bin/phpize /usr/local/opt/php55/bin/phpize: line 61: ...

  7. Install Docker on Mac OS X(转)

    Install Docker on Mac OS X You can install Docker using Boot2Docker to run docker commands at your c ...

  8. mac brew install redis

    在mac 下安装redis 执行brew install redis ==> Downloading http://download.redis.io/releases/redis-2.8.19 ...

  9. Install wget in Mac OS X Without Homebrew or MacPorts

    May 22, 2012 - 31 Comments The command line tool wget lets you retrieve a group of files from FTP an ...

随机推荐

  1. ffmpeg中关于EAGAIN的理解及非阻塞IO

    ffmpeg为在linux下开发的开源音视频框架,所以经常会碰到很多错误(设置errno),其中EAGAIN是其中比较常见的一个错误(比如用在非阻塞操作中).  try again,从字面上来看,是提 ...

  2. PAT_A1015#Reversible Primes

    Source: PAT A1015 Reversible Primes (20 分) Description: A reversible prime in any number system is a ...

  3. 解析python部分常用魔术方法

    def __add__(self, *args, **kwargs): # real signature unknown """ Return self+value. & ...

  4. top问题

    1. 从10万个数中找10个最大的数 对于这种题目,最普通的想法是先对这10万个数进行排序,然后再选取数组中前10个数,即为最后的答案,排序算法的时间复杂度不下于O(N lgN).最好的方法是建立一个 ...

  5. [luogu4799 CEOI2015 Day2] 世界冰球锦标赛(折半搜索)

    传送门 Solution 折半搜索裸题,注意\(long long\) Code #include <cmath> #include <cstdio> #include < ...

  6. Git 基础教程 之 --no-ff模式合并

    ①  创建并切换dev分支 ②  修改readme.txt,并add,commit ③  切回master ④  合并 git merge --no-ff -m “merge with no-ff”d ...

  7. cxdbImage以及图像显示

    把pdf以及图像存入数据库,然后根据需要显示出来.在处理的过程中,不同类型的图像格式有其不同的类,如果这个概念不清楚,就会绕一个很大的圈子. MyJPEG : TJPEGImage ; mypng : ...

  8. 0606关于mysql优化原理

    转自 http://blog.csdn.net/u012388497/article/details/25097159 本文通过一个案例来看看MySQL优化器如何选择索引和JOIN顺序.表结构和数据准 ...

  9. ubuntu-kill命令-杀死进程

    显示进程pid ps -A 杀进程的命令 kill -s 9 xxx(进程pid)

  10. Thread.suspend和println使线程死锁

    Thread.suspend和println使线程死锁 package com.stono.thread2.page39; public class MyThread extends Thread{ ...