Mac installation Redis

Source: Internet
Author: User
Tags tar extract

1. Official website http://redis.io/Download the latest stable version, here is 3.2.0

2. Sudu MV to/usr/local/

3. sudo tar-zxf Redis-3.2.0.tar extract File

4. Enter the extracted directory CD redis-3.2.0

5. sudo make test compile

6. Sudo make install

Installation is successful!

Configuration:

1. Set up the directory Redis under/usr/local/. Set up bin,etc,db three directories under the Redis directory

sudo mkdir/usr/local/redis/bin

....

2, the SRC directory under the Mkreleasehdr.sh,redis-benchmark, Redis-check-dump, redis-cli, redis-server copy to

Bin directory

sudo mv/usr/local/redis3.0.3/mkreleasehdr.sh/usr/local/redis/mkreleasehdr.sh

......

3, under etc, refer to the original redis3.0.3 directory of redis.conf, create a new redis.conf

Cd/usr/local/redis/etc

sudo vim redis.conf

Modify the redis.conf as follows:

#修改为守护模式daemonize yes#设置进程锁文件pidfile /usr/local/redis/redis.pid#端口port 6379#客户端超时时间timeout 300#日志级别loglevel debug#日志文件位置logfile /usr/local/redis/log-redis.log#设置数据库的数量,默认数据库为0,可以使用SELECT <dbid>命令在连接上指定数据库iddatabases 8##指定在多长时间内,有多少次更新操作,就将数据同步到数据文件,可以多个条件配合#save <seconds> <changes> #Redis默认配置文件中提供了三个条件:save 900 1save 300 10save 60 10000#指定存储至本地数据库时是否压缩数据,默认为yes,Redis采用LZF压缩,如果为了节省CPU时间,#可以关闭该#选项,但会导致数据库文件变的巨大rdbcompression yes#指定本地数据库文件名dbfilename dump.rdb#指定本地数据库路径dir /usr/local/redis/db/#指定是否在每次更新操作后进行日志记录,Redis在默认情况下是异步的把数据写入磁盘,如果不开启,可能#会在断电时导致一段时间内的数据丢失。因为 redis本身同步数据文件是按上面save条件来同步的,所以有#的数据会在一段时间内只存在于内存中appendonly no#指定更新日志条件,共有3个可选值: #no:表示等操作系统进行数据缓存同步到磁盘(快) #always:表示每次更新操作后手动调用fsync()将数据写到磁盘(慢,安全) #everysec:表示每秒同步一次(折衷,默认值)appendfsync everysec

6. Modify the permissions for the current user xxx

Chown-r Xxxx/usr/local/redis

7. Start the service

Cd/usr/local/redis

./bin/redis-server./etc/redis.conf

8. Access to Services

Cd/usr/local/redis

./bin/redis-cli

Mac installation Redis

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.