2014年9月3日 星期三

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

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

2014-09-03
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-2.8.14.tar.gz

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

安裝

yum -y install gcc gcc-c++
cd /usr/local/src
wget http://download.redis.io/releases/redis-2.8.14.tar.gz
tar zxvf redis-2.8.14.tar.gz
cd redis-2.8.14
#make MALLOC=libc
make
make install


yum -y install tcl
make test

cp redis.conf /etc/.



make test 在執行時候某些步驟會需要些時間

[35/36 done]: unit/obuf-limits (78 seconds)
[36/36 done]: unit/memefficiency (339 seconds)

參數

[root@localhost redis-2.8.14]# 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 redis-2.8.14]#


啟動

[root@localhost ~]# /usr/local/bin/redis-server   /etc/retdis.conf  &

測試

[root@localhost ~]# /usr/local/bin/redis-server  -v
Redis server v=2.8.14 sha=00000000:0 malloc=jemalloc-3.6.0 bits=64 build=8bd270d13c19d2d5


[root@localhost ~]# ps aux | grep redis
root     18743  0.0  0.4 140752  7792 pts/1    Sl   00:26   0:00 redis-server *:6379
root     18748  0.0  0.0 112640   964 pts/1    R+   00:27   0:00 grep --color=auto redis

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


[root@localhost redis-2.8.14]# systemctl stop firewalld
[root@localhost redis-2.8.14]# systemctl status firewalld
firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled)
   Active: inactive (dead) since Wed 2014-09-03 00:19:57 CST; 7min ago
 Main PID: 884 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/firewalld.service

Jul 25 20:09:07 localhost.localdomain systemd[1]: Started firewalld - dynamic...
Sep 03 00:19:57 localhost.localdomain systemd[1]: Stopping firewalld - dynami...
Sep 03 00:19:57 localhost.localdomain systemd[1]: Stopped firewalld - dynamic...
Sep 03 00:27:52 localhost.localdomain systemd[1]: Stopped firewalld - dynamic...
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost redis-2.8.14]#


[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.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)
http://forum.icst.org.tw/phpbb/viewtopic.php?t=19575

沒有留言:

張貼留言