Redis is an open source (BSD licensed), in-memory data structure store, used as database, cache and message broker. It supports data structures such a ...
Redis is an open source (BSD licensed), in-memory data structure store, used as database, cache and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs and geospatial indexes with radius queries. Redis has built-in replication, Lua scripting, LRU eviction, transactions and different levels of on-disk persistence, and provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster.
Redis是個開源的(BSD協議),記憶體數據結構存儲,用來當做資料庫,緩存和消息中間件。支持的數據結果有strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs和地理空間索引半徑查詢。Redis有內嵌副本,Lua腳本,最近最少使用回收,事物以及不同級別的硬碟持久化。通過Redis Sentinel提供高可用和Redis Cluster的自動分區。
官網地址:
NoSql分類:
資料庫引擎排名網址:
http://db-engines.com/en/ranking
Redis可視化客戶端:
RedisDesktopManager
Redis單節點安裝
操作系統 CentOS 6.5
安裝依賴包
yum install -y gcc tcl
解壓安裝包
tar xf redis-2.8.18.tar.gz
創建安裝目錄
mkdir -p /usr/redis
編譯
make
然後
make install #預設安裝到/usr/local/bin
或
make PREFIX=/usr/redis install #指定安裝目錄/usr/redis
Redis可執行程式:
redis-benchmark redis-check-aof redis-check-dump redis-cli redis-server
配置環境變數
export REDIS_HOME=/usr/redis
export PATH=$PATH:$REDIS_HOME/bin
安裝啟動服務
cd utils ./install_server.sh
重命名服務文件
mv /etc/init.d/redis_6379 /etc/init.d/redisd
開機啟動
chkconfig redisd on
啟動服務
service redisd start
配置文件:
vim /etc/redis/6379.conf
# 後臺服務 daemonize yes port 6379 # 預設DB是0,設置DB的數目 databases 16 # 2種持久化方式 # RDB: Redis DB 預設開啟 # 下麵是執行快照的條件 # In the example below the behaviour will be to save: # after 900 sec (15 min) if at least 1 key changed # after 300 sec (5 min) if at least 10 keys changed # after 60 sec if at least 10000 keys changed save 900 1 save 300 10 save 60 10000 dbfilename dump.rdb # AOF 預設關閉 appendonly no appendfilename "appendonly.aof" appendfsync everysec