[TOC]
centos6.6安裝redis3.0.2
1介紹
redis用作系統(tǒng)的緩存
2安裝流程以及中間出現(xiàn)的問題
# 由于本人使用Python作為開發(fā)語言飘痛,所以習(xí)慣下面的備注信息使用#符號(hào)
# 下面命令我是在root用戶下運(yùn)行
# 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
# 以下為中間出現(xiàn)的報(bào)錯(cuò)信息和解決方式
# 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
# 上面是說找不到鏡像,首先考慮的是網(wǎng)絡(luò)問題兼都,想到了DNS服務(wù)器配置嫂沉,之前 以為別人已經(jīng)配置過了,沒想到?jīng)]有
# 以下為配置DNS服務(wù)器
# vi /etc/resolv.conf
# 將其內(nèi)容改為以下內(nèi)容(我的之前沒有俯抖,是自己vi新建的)
nameserver 8.8.8.8
nameserver 202.106.0.20
# 之后重啟網(wǎng)絡(luò)服務(wù)
# /etc/init.d/network restart
# 運(yùn)行結(jié)果如下
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 ]
# 設(shè)置配置文件路徑
# mkdir -p /etc/redis
# 回到redis目錄下面输瓜,/usr/local/redis
# cd /usr/local/redis
# cp redis.conf /etc/redis
# 修改配置文件
# vi /etc/redis/redis.conf
# 暫時(shí)只修改守護(hù)進(jìn)程
daemonize yes (no-->yes)
# 啟動(dòng)redis
# /usr/local/bin/redis-server /etc/redis/redis.conf
# 查看啟動(dòng)
# ps -ef | grep redis
# 使用客戶端
# redis-cli
# 關(guān)閉客戶端
# redis-cli shutdown
# 設(shè)置開機(jī)啟動(dòng)
# echo "/usr/local/bin/redis-server /etc/redis/redis.conf &" >> /etc/rc.local
至此,有關(guān)redis的安裝基本完成芬萍,有關(guān)后面的配置設(shè)置操作留待后面解決尤揣。