Redis (1) —— 安装

摘要

介绍Mac OS X安装Redis基本方法

版本

Redis版本: 2.8.24


内容

下载Redis包

地址:http://download.redis.io/releases/

找到合适的版本,这里以2.8.24为例。

wget http://download.redis.io/releases/redis-2.8.24.tar.gz

安装

⇒  tar xzvf redis-2.8.24.tar.gz

输出

...
x redis-2.8.24/utils/mkrelease.sh
x redis-2.8.24/utils/redis-copy.rb
x redis-2.8.24/utils/redis-sha1.rb
x redis-2.8.24/utils/redis_init_script
x redis-2.8.24/utils/redis_init_script.tpl
x redis-2.8.24/utils/speed-regression.tcl
x redis-2.8.24/utils/whatisdoing.sh

make && install

⇒  sudo make && make install

输出中可能包含一下warning信息,可以忽略

最后会提示建议make test

使用配置工具util

在"redis-2.8.24/util"下

⇒  cd utils

⇒  sudo ./install_server.sh

输出

Password:
readlink: illegal option -- f
usage: readlink [-n] [file ...]
usage: dirname path
Welcome to the redis service installer
This script will help you easily set up a running redis server Please select the redis port for this instance: [6379]
Selecting default: 6379
Please select the redis config file name [/etc/redis/6379.conf]
Selected default - /etc/redis/6379.conf
Please select the redis log file name [/var/log/redis_6379.log]
Selected default - /var/log/redis_6379.log
Please select the data directory for this instance [/var/lib/redis/6379]
Selected default - /var/lib/redis/6379
Please select the redis executable path [/usr/local/bin/redis-server]
Selected config:
Port : 6379
Config file : /etc/redis/6379.conf
Log file : /var/log/redis_6379.log
Data dir : /var/lib/redis/6379
Executable : /usr/local/bin/redis-server
Cli Executable : /usr/local/bin/redis-cli
Is this ok? Then press ENTER to go on or Ctrl-C to abort.
Mmmmm... the default config is missing. Did you switch to the utils directory?

配置文件redis.conf

redis解压目录里有一个配置文件redis.conf ,编辑此配置文件,找到 dir ./ 这一行。redis会将内存中的数据写入文件中,而此配置就是指定数据文件保存的路径。我本机指定的目录为:

/Users/Richard/Documents/Dev/servers/redis/redis_data

编辑过后,将配置文件移动到 /usr/local/etc 目录下

sudo mv redis.conf /usr/local/etc

启动

⇒  /usr/local/bin/redis-server /usr/local/etc/redis.conf

测试连通性

设置开机自动启动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/><span style="font-size:14px;"></span> </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下也可以使用homebrew来安装redis


参考

Redis(一)安装配置

Mac OS X安装Redis

在 Mac 下安装 Redis 的问题

mac 下安装运行 redis

Redis (1) —— 安装的更多相关文章

  1. redis的安装配置

    主要讲下redis的安装配置,以及以服务的方式启动redis 1.下载最新版本的redis-3.0.7  到http://redis.io/download中下载最新版的redis-3.0.7 下载后 ...

  2. Linux下Redis的安装和部署

    一.Redis介绍 Redis是当前比较热门的NOSQL系统之一,它是一个key-value存储系统.和Memcache类似,但很大程度补偿了Memcache的不足,它支持存储的value类型相对更多 ...

  3. 基于C#的MongoDB数据库开发应用(4)--Redis的安装及使用

    在前面介绍了三篇关于MongoDB数据库的开发使用文章,严格来讲这个不能归类于MongoDB数据库开发,不过Redis又有着和MongoDB数据库非常密切的关系,它们两者很接近,Redis主要是内存中 ...

  4. Linux下Redis的安装与配置

    redis是当前比较热门的NOSQL系统之一,它是一个key-value存储系统.和Memcached类似,但很大程度补偿了 memcached的不足,它支持存储的value类型相对更多,包括stri ...

  5. [nosql之redis]yum安装redis

    1.首先对于这种nosql来说目前我用到的功能很少,所以感觉没有必要去优化他跟不需要去编译安装.今天来介绍下一个yum安装redis 步骤1:安装扩展yum库 [root@localhost ~]# ...

  6. Linux下redis的安装

    第一部分:安装redis 希望将redis安装到此目录 /usr/local/redis 希望将安装包下载到此目录 /usr/local/src 那么安装过程指令如下: $ mkdir /usr/lo ...

  7. redis的安装和启动

    Windows下Redis的安装及PHP扩展使用 时间 2014-10-28 17:47:09  CSDN博客 原文  http://blog.csdn.net/wyqwclsn/article/de ...

  8. linux下redis的安装与部署及基础命令

    <1>下载安装文件:redis-3.2.5.tar.gz 放在opt目录下 <2> tar -zxvf redis-3.2.5.tar.gz,备份redis.conf到自己的目 ...

  9. redis/php redis扩展 安装

    作者:silenceper 日期:2013-10-03 原文地址: http://silenceper.com/archives/952.html 我是在CentOS 6.3 中进行的. 使用到的软件 ...

  10. [Linux]Linux下redis的安装及配置.

    在上一篇[Linux] linux下安装配置 zookeeper/redis/solr/tomcat/IK分词器 详细实例. 我们已经将redis所需tar包拷贝到了linux下的root 根目录下, ...

随机推荐

  1. Ubuntu局域网下利用client联网

    Ubuntu是一个非常好的Linux操作系统,可是对于刚刚安装使用它的新手来说如何用Ubuntu连入网络却是一大难关.如今就记录一下自己在Ubuntu下上网的过程. ★client 将client解压 ...

  2. 常用的apache commons工具,直接使用,便于快速开发

    详情 :http://commons.apache.org/ Components Description Latest Version Released Attributes Runtime API ...

  3. wget for windows

    那么,来尝试下wget for windows 吧. 什么是wget? wget是一个强力方便的命令行下的下载工具,可以通过HTTP和FTP协议(两种最广泛的互联网协议)从因特网中检索并获取文件. 此 ...

  4. Python 爬虫 数据清洗 去掉 超链接

    有时候我们需要清洗数据,里面有超链接,怎么去掉他们,比如下面的问题 , - January , </p></li><li </p><div " ...

  5. Latex中如何设置字体颜色(3种方式)

    Latex中如何设置字体颜色(三种方式)   1.直接使用定义好的颜色 \usepackage{color} \textcolor{red/blue/green/black/white/cyan/ma ...

  6. ThinkPHP32 MODULE_ALLOW_LIST 存在的bug 不生效

    1)BUG: 假设存在Api Home Admin Member 模块.仅仅想让用户訪问 Api Home,不同意訪问Admin Member. 必须将Admin Member 写在 MODULE_D ...

  7. 在Android Studio 和 Eclipse 的 git 插件操作 "代码提交"以及"代码冲突"

    面向对象:曾经使用过SVN的同学. (因为Git 它 可以说是双重的SVN (本地一个服务器,远程一个服务器)),提交代码要有两次步骤,先提交到本地服务器,再把本地服务器在提交到远程服务器. 所以连S ...

  8. AlloyTouch全屏滚动插件搞定顺滑H5页

    使用姿势 在设计全屏滚动插件的时候,希望开发者几乎: 不用写任何脚本快速生成精致H5 支持PC滚轮和移动触摸 酷炫的转场动效 灵活的时间轴管理 一切皆可配置 但是不写脚本肯定没有灵活性咯?!不是的.这 ...

  9. SVN四部曲之SVN设置详解深入

    想知道不同的设置是干什么用的,你只需将鼠标指针在编辑框/选项框上停留一秒钟...一个帮助提示气泡就会弹出来. 常规设置 图 4.68. 设置对话框,常规设置页面 这个对话框允许你指定自己喜欢的语言,同 ...

  10. [Windows Azure] What is a Storage Account?

    What is a Storage Account? A storage account gives your applications access to Windows Azure Blob, T ...