1

[TOC]

centos6.6安装redis3.0.2

1介绍

redis用作系统的缓存

2安装流程以及中间出现的问题
# 由于本人使用Python作为开发语言,所以习惯下面的备注信息使用#符号
# 下面命令我是在root用户下运行
# yum -y install gcc make tcl
# wget http://download.redis.io/releases/redis-3.0.2.tar.gz
# tar -zxvf redis-3.0.2.tar.gz
# mv redis-3.0.2 /usr/local/redis
# cd /usr/local/redis
# make
# make test
# make install
# 以下为中间出现的报错信息和解决方式
# yum -y install gcc make tcl

Loaded plugins: fastestmirror
Setting up Install Process
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os&infra=stock error was
14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again

# 上面是说找不到镜像,首先考虑的是网络问题,想到了DNS服务器配置,之前 以为别人已经配置过了,没想到没有
# 以下为配置DNS服务器
# vi /etc/resolv.conf
# 将其内容改为以下内容(我的之前没有,是自己vi新建的)
nameserver 8.8.8.8
nameserver 202.106.0.20

# 之后重启网络服务
# /etc/init.d/network restart
# 运行结果如下
Shutting down interface eth0:                              [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:  Determining if ip address 192.168.17.39 is already in use for device eth0...                        [  OK  ]
# 设置配置文件路径
# mkdir -p /etc/redis
# 回到redis目录下面,/usr/local/redis
# cd /usr/local/redis
# cp redis.conf /etc/redis
# 修改配置文件
# vi /etc/redis/redis.conf
# 暂时只修改守护进程
daemonize yes (no-->yes)
# 启动redis
# /usr/local/bin/redis-server /etc/redis/redis.conf
# 查看启动
# ps -ef | grep redis
# 使用客户端
# redis-cli
# 关闭客户端
# redis-cli shutdown
# 设置开机启动
# echo "/usr/local/bin/redis-server /etc/redis/redis.conf &" >> /etc/rc.local

至此,有关redis的安装基本完成,有关后面的配置设置操作留待后面解决。


Hwan
28 声望3 粉丝

web开发者,Python热爱者