redis python-redis 安装详细步骤
2017-03-27 13:47
597 查看
转载:http://www.cnblogs.com/cbreeze/p/5947140.html
安装Redis
把redis安装到 /opt/redis-2.8目录中
wget http://download.redis.io/releases/redis-2.8.1.tar.gz tar -zxfx redis-2.8.1.tar.gz
cd redis-2.8.1
make && make PREFIX=/opt/redis-2.8 install
cp redis.conf /opt/redis-2.8/
只是把redis当做队列用,不需要存储,所以编辑 /opt/redis-2.8/redis.conf
设置 daemonize yes
把3条
启动redis 非常简单:
wget http://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz tar -zvxf Python-2.7.6.tgz
cd Python-2.7.6
./configure
make && make install
替换系统默认的python:
安装python的redis模块
wget --no-check-certificate https://pypi.python.org/packages/source/r/redis/redis-2.8.0.tar.gz tar -zvxf redis-2.8.0.tar.gz
mv redis-2.8.0 python-redis-2.8.0
cd python-redis-2.8.0
python setup.py install
部署成功,写段代码验证一下
True
执行成功
安装Redis
把redis安装到 /opt/redis-2.8目录中
wget http://download.redis.io/releases/redis-2.8.1.tar.gz tar -zxfx redis-2.8.1.tar.gz
cd redis-2.8.1
make && make PREFIX=/opt/redis-2.8 install
cp redis.conf /opt/redis-2.8/
只是把redis当做队列用,不需要存储,所以编辑 /opt/redis-2.8/redis.conf
设置 daemonize yes
把3条
save ..都注释掉,这样就关闭了硬盘存储
启动redis 非常简单:
/opt/redis-2.8/bin/redis-server /opt/redis-2.8/redis.conf
$REIDS_INSTALL_DIR/utils/redis_init_script这个脚本稍做修改就可以放到/etc/init.d 作为redis启动脚本用
安装python
CentOS 自带的python2.4,太旧了,升级到2.7wget http://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz tar -zvxf Python-2.7.6.tgz
cd Python-2.7.6
./configure
make && make install
替换系统默认的python:
sudo ln -s /usr/local/bin/python2.7 /usr/bin/python
安装python的redis模块
wget --no-check-certificate https://pypi.python.org/packages/source/r/redis/redis-2.8.0.tar.gz tar -zvxf redis-2.8.0.tar.gz
mv redis-2.8.0 python-redis-2.8.0
cd python-redis-2.8.0
python setup.py install
部署成功,写段代码验证一下
import redis client = redis.StrictRedis(host='localhost', port=6379) print client.ping()
True
执行成功
相关文章推荐
- redis python-redis 安装详细步骤
- redis python-redis 安装详细步骤
- redis python-redis 安装详细步骤
- CentOS 6.5下Redis安装详细步骤
- redis3.0.0 集群安装详细步骤
- redis3.0.5集群部署安装详细步骤
- redis3.0.0 集群安装详细步骤
- CentOS 6.5下Redis安装详细步骤
- redis python-redis 安装详细步骤(整理中)
- redis3.0.0 集群安装详细步骤
- redis3.0.0 集群安装详细步骤-【超人学院】
- redis3.0.0 集群安装详细步骤
- Python和Django的详细安装步骤
- redis python-redis 安装详细步骤
- 在centos 6.2,python2.7 下安装QT 4.8.3,pyqt 4.9.5 详细步骤
- Windows 下面安装和使用Python, IPython NoteBook (详细步骤)
- 在centos 6.2,python2.7 下安装QT 4.8.3,pyqt 4.9.5 详细步骤
- redis 集群安装详细步骤
- redis3.0.3集群安装详细步骤
- CentOS 6.5下Redis安装详细步骤