歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Redis 安裝

Redis 安裝

日期:2017/2/28 15:52:37   编辑:Linux教程

Redis 簡介

官網:http://redis.io/

高效K-V存儲,redis目前提供四種數據類型:string,list,set及zset(sorted set)。


Redis 安裝

wget http://redis.googlecode.com/files/redis-2.4.4.tar.gz;

tar zxvf redis-2.4.4.tar.gz

cd redis-2.4.4

make

在redis包目錄下修改redis.conf配置文件

設置啟動方式和啟動端口

daemonize yes
port = 6666

Redis支持master/slave模式

在配置文件中設置slaveof 屬性 就將以從庫啟動

當前目錄啟動redis

src/redis-server redis.conf

在當前目錄啟動後,如果設置了持久化,那麼持久化文件就會保存在你啟動redis時的那個目錄下。

盡量不要設置最大內存使用,不然一旦超出最大內存,可能出現死鎖bug。

redis訪問是沒有密碼的,盡量處於內網環境,或者使用iptables防火牆屏蔽tcp端口。

Copyright © Linux教程網 All Rights Reserved