FreeBSD下安装redis以及redis_py

查找redis

suse# whereis redis
redis: /usr/ports/databases/redis

 

安装redis

suse# make

suse# make install

启动

suse# /usr/local/bin/redis-server
[6314] 19 Dec 00:22:06 # Warning: no config file specified, using the default config. In order to specify a config file use 'redis-server /path/to/redis.conf'
[6314] 19 Dec 00:22:06 * Server started, Redis version 2.2.15
[6314] 19 Dec 00:22:06 * The server is now ready to accept connections on port 6379
[6314] 19 Dec 00:22:06 - 0 clients connected (0 slaves), 621464 bytes in use

 

安装 python redis

git clone https://github.com/andymccurdy/redis-py.git

suse# cd redis-py/
suse# python setup.py install

或者

[suse# easy_install redis

Searching for redis
Best match: redis 2.4.10
Adding redis 2.4.10 to easy-install.pth file

Using /usr/local/lib/python2.7/site-packages
Processing dependencies for redis
Finished processing dependencies for redis]

 

安装ipython

suse# whereis ipython
ipython: /usr/ports/devel/ipython
suse# cd /usr/ports/devel/ipython

suse# make

suse# make install

 

安装 setup-tools

suse# wget http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg
--2011-12-19 00:28:39-- http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg
Resolving pypi.python.org (pypi.python.org)... 82.94.164.168, 2001:888:2000:d::a8
Connecting to pypi.python.org (pypi.python.org)|82.94.164.168|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 332005 (324K) [application/octet-stream]
Saving to: `setuptools-0.6c11-py2.7.egg'

100%[==================================================================================================================>] 332,005 38.7K/s in 8.4s

2011-12-19 00:28:49 (38.7 KB/s) - `setuptools-0.6c11-py2.7.egg' saved [332005/332005]

suse# sh setuptools-0.6c11-py2.7.egg
Processing setuptools-0.6c11-py2.7.egg
Copying setuptools-0.6c11-py2.7.egg to /usr/local/lib/python2.7/site-packages
Adding setuptools 0.6c11 to easy-install.pth file
Installing easy_install script to /usr/local/bin
Installing easy_install-2.7 script to /usr/local/bin

Installed /usr/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg
Processing dependencies for setuptools==0.6c11
Finished processing dependencies for setuptools==0.6c11

 

开始体验:

开启redis server

suse# /usr/local/bin/redis-server
[32692] 19 Dec 00:31:17 # Warning: no config file specified, using the default config. In order to specify a config file use 'redis-server /path/to/redis.conf'
[32692] 19 Dec 00:31:17 * Server started, Redis version 2.2.15
[32692] 19 Dec 00:31:17 * The server is now ready to accept connections on port 6379
[32692] 19 Dec 00:31:17 - 0 clients connected (0 slaves), 621464 bytes in use

 

suse# python
Python 2.7.2 (default, Nov 22 2011, 22:07:16)
[GCC 4.2.1 20070831 patched [FreeBSD]] on freebsd9
Type "help", "copyright", "credits" or "license" for more information.
>>> import redis
>>> r = redis.StrictRedis(host='localhost',port=6379,db=0)
>>> r.set('foo','bar')
True
>>> r.get('foo')
'bar'

看样子还不错哦,其他的还没有尝试。

 

 

 

 

转载于:https://www.cnblogs.com/1q84/archive/2011/12/18/2291840.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值