设为首页 加入收藏

TOP

redis的基础学习(二)
2014-11-24 00:57:20 来源: 作者: 【 】 浏览:31
Tags:redis 基础 学习
heck_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : redis 1/1
Installed:
redis.i386 0:2.4.10-1.el5
Complete!
[root@mysql ~]
[root@mysql ~]# find / -name "redis*"
/usr/share/doc/redis-2.4.10
/usr/bin/redis-check-dump
/usr/bin/redis-benchmark
/usr/bin/redis-cli
/usr/bin/redis-check-aof
/usr/sbin/redis-server
/etc/redis.conf
/etc/logrotate.d/redis
/etc/rc.d/init.d/redis
/var/run/redis
/var/lib/redis
/var/log/redis
[root@mysql ~]#
[root@mysql ~]# ps aux|grep redis
root 4148 0.0 0.2 31056 1088 Ssl 22:44 0:00 redis-server /etc/redis.conf
root 4153 0.0 0.1 4008 668 pts/2 R+ 22:44 0:00 grep redis
[root@mysql ~]# telnet localhost 6379
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
set song 8
+OK
get song
$1
8
set xixi
-ERR wrong number of arguments for 'set' command
get ^H
$-1
set song xi
+OK
get xi
$-1
get song
$2
xi
lpush 11 11 ^H
:2
lpush 11 22
:3
rpush 55 66
:1
lrange 11 0 -1
*3
$2
22
$1
$2
11
s
-ERR unknown command 's'
del 33
:0
lrange 11 0 -1
*3
$2
22
$1
$2
11
quit
+OK
Connection closed by foreign host.
[root@mysql ~]#
Ruby连接Redis数据库测试
1. 下载ruby程序包
[root@mysql ~]# rpm -qa | grep ruby
[root@mysql ~]#
[root@mysql ~]# mkdir ruby
[root@mysql ~]# cd ruby/
[root@mysql ruby]# pwd
/root/ruby
[root@mysql ruby]# wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p180.tar.gz
--2013-07-01 22:49:15-- http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p180.tar.gz
Resolving ftp.ruby-lang.org... 221.186.184.68
Connecting to ftp.ruby-lang.org|221.186.184.68|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11158935 (11M) [application/x-tar]
Saving to: `ruby-1.9.2-p180.tar.gz'
100%[======================================>] 11,158,935 52.6K/s in 3m 30s
2013-07-01 22:52:47 (51.8 KB/s) - `ruby-1.9.2-p180.tar.gz' saved [11158935/11158935]
[root@mysql ruby]#
tar -zxvf ruby-1.9.2-p180.tar.gz
[root@mysql ruby]# cd ruby-1.9.2-p180
[root@mysql ruby-1.9.2-p180]# ./configure
checking whether ELF binaries are produced... yes
checking whether OS depend dynamic link works... yes
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for if make is GNU make... yes
checking for nroff... /usr/bin/nroff
.ext/include/i686-linux/ruby/config.h updated
ruby library version = 1.9.1
configure: creating ./config.status
config.status: creating Makefile
[root@mysql ruby-1.9.2-p180]# make
Generating RI...
Files: 515
Classes: 1087 ( 654 undocumented)
Constants: 1364 ( 1141 undocumented)
Modules: 239 ( 137 undocumented)
Methods: 7642 ( 2876 undocumented)
53.46% documented
Elapsed: 87.4s
[root@mysql ruby-1.9.2-p180]# make install
installing extension scripts: /usr/local/lib/ruby/site_ruby/1.9.1
in
首页 上一页 1 2 3 4 下一页 尾页 2/4/4
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇PowerDesigner需要设置的几项 下一篇数据库基础学习--SQL语句的连接方..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: