在centos6.9系统中编译安装redis3.2.9版本
1、安装所需依赖
yum -y install gcc gcc-c++ wget
|---|---------------------------------| | 1 | yum -y install gcc gcc-c++ wget |
2、下载redis3.2.9源码包
cd /usr/local/src/ wget https://download.redis.io/releases/redis-3.2.9.tar.gz
|-----|-------------------------------------------------------------------------------| | 1 2 | cd /usr/local/src/ wget https://download.redis.io/releases/redis-3.2.9.tar.gz |
3、解压缩编译安装
tar zxf redis-3.2.9.tar.gz cd redis-3.2.9/deps/ make geohash-int hiredis jemalloc linenoise lua
|-------|-------------------------------------------------------------------------------------------------| | 1 2 3 | tar zxf redis-3.2.9.tar.gz cd redis-3.2.9/deps/ make geohash-int hiredis jemalloc linenoise lua |


cd .. make
|-----|------------| | 1 2 | cd .. make |


make install
|---|--------------| | 1 | make install |

4、使用脚本安装服务
cd utils/ ./install_server.sh
|-----|-------------------------------| | 1 2 | cd utils/ ./install_server.sh |

5、安装服务完成后会启动redis服务
可以使用netstat -ntp | grep redis命令查看

或

6、设置redis开机自启
chkconfig --add redis_6379 chkconfig redis_6379 on
|-----|----------------------------------------------------| | 1 2 | chkconfig --add redis_6379 chkconfig redis_6379 on |
7、redis状态、启动、停止
/etc/init.d/redis_6379 status /etc/init.d/redis_6379 start /etc/init.d/redis_6379 stop
|-------|----------------------------------------------------------------------------------------| | 1 2 3 | /etc/init.d/redis_6379 status /etc/init.d/redis_6379 start /etc/init.d/redis_6379 stop |
8、可以使用redis-cli客户端连接下redis
redis-cli -h 127.0.0.1 -p 6379
|---|--------------------------------| | 1 | redis-cli -h 127.0.0.1 -p 6379 |
51工具盒子
