2015年6月1日 星期一

[研究] Redis 2.8.19 資料庫 安裝(yum)(CentOS 7.1 x86_64)

[研究] Redis 2.8.19 資料庫 安裝(yum)(CentOS 7.1 x86_64)

2015-06-01
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"
rpm   -ivh   http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.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.19 sha=00000000:0 malloc=jemalloc-3.6.0 bits=64 build=c0359e7aa3798aa2
[root@localhost ~]#


[root@localhost ~]# redis-server  -v
Redis server v=2.8.19 sha=00000000:0 malloc=jemalloc-3.6.0 bits=64 build=c0359e7aa3798aa2
[root@localhost ~]# ps aux | grep redis
redis     15597  0.0  0.3 142688  5720 ?        Ssl  16:53   0:00 /usr/bin/redi -server 127.0.0.1:6379
root      15613  0.0  0.0 112640   956 pts/1    S+   16:53   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      15597/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 Mon 2015-06-01 16:54:23 CST; 3s ago
 Main PID: 966 (code=exited, status=0/SUCCESS)

Jun 01 15:02:44 localhost.localdomain systemd[1]: Started firewalld - dynamic...
Jun 01 16:54:22 localhost.localdomain systemd[1]: Stopping firewalld - dynami...
Jun 01 16:54:23 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.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)
http://forum.icst.org.tw/phpbb/viewtopic.php?t=19575

沒有留言:

張貼留言