2014年9月23日 星期二

[研究] Redis 2.8.13 資料庫 安裝(yum)(CentOS 7.0 x86_64)

[研究] Redis 2.8.13 資料庫 安裝(yum)(CentOS 7.0 x86_64)

2014-09-23
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 groupinstall "Development Tools"
rpm -ivh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-1.noarch.rpm
yum -y install redis
systemctl enable redis.service
systemctl start redis.service
systemctl --all | grep redis

參數

[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=2.8.13 sha=00000000:0 malloc=jemalloc-3.6.0 bits=64 build=3693c764996dafec
[root@localhost ~]#


[root@localhost ~]# ps aux | grep redis
redis    14009  0.0  0.3 142668  5700 ?        Ssl  18:50   0:00 /usr/bin/redis-server 127.0.0.1:6379
root     14026  0.0  0.0 112640   980 pts/1    R+   18:52   0:00 grep --color=auto redis
[root@localhost ~]#


[root@localhost ~]# netstat -ntplu | grep redis
tcp        0      0 127.0.0.1:6379          0.0.0.0:*               LISTEN      14009/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 2014-09-23 20:11:59 CST; 5s ago
 Main PID: 884 (code=exited, status=0/SUCCESS)

Jul 25 20:09:07 localhost.localdomain systemd[1]: Started firewalld - dynamic...
Sep 23 20:11:59 localhost.localdomain systemd[1]: Stopping firewalld - dynami...
Sep 23 20:11:59 localhost.localdomain systemd[1]: Stopped firewalld - dynamic...
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost ~]#



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

沒有留言:

張貼留言