2015年6月2日 星期二

[研究] Redis 3.0.1 資料庫 安裝(tar.gz)(CentOS 7.1 x86_64)

[研究] Redis 3.0.1 資料庫 安裝(tar.gz)(CentOS 7.1 x86_64)

2015-06-02
Lu

Redis is an open source, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets.

官方網站
http://redis.io/

下載
http://redis.io/download
http://code.google.com/p/redis/downloads/list
直接下載
http://download.redis.io/releases/redis-3.0.1.tar.gz

安裝參考
http://redis.io/download

安裝

# yum -y groupinstall "Development Tools"

yum   -y   install   gcc
wget   http://download.redis.io/releases/redis-3.0.1.tar.gz
cd   redis-3.0.1

make distclean
cd deps
make hiredis jemalloc linenoise lua
cd ..
make

yum   -y   install   tcl
make test

啟動

[root@localhost ~]# redis-server  &

參數

[root@localhost ~]# redis-server --help
Usage: ./redis-server [/path/to/redis.conf] [options]
       ./redis-server - (read config from stdin)
       ./redis-server -v or --version
       ./redis-server -h or --help
       ./redis-server --test-memory <megabytes>

Examples:
       ./redis-server (run the server with default conf)
       ./redis-server /etc/redis/6379.conf
       ./redis-server --port 7777
       ./redis-server --port 7777 --slaveof 127.0.0.1 8888
       ./redis-server /etc/myredis.conf --loglevel verbose

Sentinel mode:
       ./redis-server /etc/sentinel.conf --sentinel
[root@localhost ~]#

設定檔案 /etc/retdis.conf

測試



[root@localhost ~]# redis-server  -v
Redis server v=3.0.1 sha=00000000:0 malloc=jemalloc-3.6.0 bits=64 build=7d85349cd20c11a3

[root@localhost ~]# ps aux | grep redis
root      20033  0.0  0.4 140836  7816 pts/1    Sl   14:49   0:00 redis-server *:6379
root      20046  0.0  0.0 112640   956 pts/1    R+   14:49   0:00 grep --color=auto redis

[root@localhost ~]#  netstat -ntplu | grep redis
tcp        0      0 0.0.0.0:6379            0.0.0.0:*               LISTEN      20033/redis-server
tcp6       0      0 :::6379                 :::*                    LISTEN      20033/redis-server

[root@localhost ~]#

[root@localhost ~]# systemctl stop firewalld

[root@localhost ~]# systemctl status firewalld
firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled)
   Active: inactive (dead) since Tue 2015-06-02 14:50:31 CST; 5s ago
  Process: 966 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=0/SUCCESS)
 Main PID: 966 (code=exited, status=0/SUCCESS)

Jun 01 15:02:44 localhost.localdomain systemd[1]: Started firewalld - dynamic...
Jun 02 14:50:31 localhost.localdomain systemd[1]: Stopping firewalld - dynami...
Jun 02 14:50:31 localhost.localdomain systemd[1]: Stopped firewalld - dynamic...
Hint: Some lines were ellipsized, use -l to show in full.

[root@localhost ~]# redis-cli set foo bar
OK
[root@localhost ~]# redis-cli get foo
"bar"

[root@localhost ~]# yum -y install telnet
[root@localhost ~]# telnet 127.0.0.1 6379
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
set foo 3
+OK
get foo
$1
3
^]
telnet> quit
Connection closed.
[root@localhost ~]#


更多命令介紹參考文檔介紹。
http://code.google.com/p/redis/wiki/CommandReference

(完)

相關

[研究] Redis 2.8.19 資料庫 安裝(yum)(CentOS 7.1 x86_64)
http://shaurong.blogspot.com/2015/06/redis-2819-yumcentos-71-x8664.html

[研究] Redis 2.8.13 資料庫 安裝(yum)(CentOS 7.0 x86_64)
http://shaurong.blogspot.com/2014/09/redis-2813-yumcentos-70-x8664.html

[研究] Redis 2.8.14 資料庫 安裝(tar.gz)(CentOS 7.0 x86_64)
http://shaurong.blogspot.com/2014/09/redis-2814-targzcentos-70-x8664.html

[研究] Redis 2.8.4 資料庫 安裝(tar.gz)(CentOS 6.5 x64)
http://shaurong.blogspot.com/2014/01/redis-284-targzcentos-65-x64.html

[研究] Redis 2.4.10 資料庫 安裝(yum) (CentOS 6.5 x64)
http://shaurong.blogspot.tw/2014/01/redis-2410-yum-centos-65-x64.html

[研究] Redis 2.0.4 資料庫 安裝 (CentOS 5.5 x86)


沒有留言:

張貼留言