首页 > 代码库 > redis单机搭建
redis单机搭建
1. 创建分用户(用于启动redis)
[root@Centos6 ~]# useradd redis
2. 切换到分用户环境
[root@Centos6 ~]# sudo su – redis
3. 上传redis软件或者wget http://download.redis.io/releases/redis-3.2.6.tar.gz
[redis@Centos6 ~]$ rz -y
rz waiting to receive.
Starting zmodem transfer. PressCtrl+C to cancel.
Transferring redis-3.2.6.tar.gz...
100% 1508 KB 1508 KB/sec 00:00:01 0 Errors
[redis@Centos6 ~]$ ls
redis-3.2.6.tar.gz
4. 解压缩redis文件并安装
[redis@Centos6 ~]$ mkdir run
[redis@Centos6 ~]$ tar zxf redis-3.2.6.tar.gz –C run/
[redis@Centos6 ~]$ cd run/redis-3.2.6/
[redis@Centos6 redis-3.2.6]$ make
5. 启动redis(这里使用默认配置文件进行启动)
[redis@Centos6 ~]$ ~/run/redis-3.2.6/src/redis-server~/run/redis-3.2.6/redis.conf &
[redis@Centos6 ~]$ netstat -lantup|grep redis
(Not all processes could be identified, non-owned process info
will not be shown, you wouldhave to be root to see it all.)
tcp 0 0127.0.0.1:6379[l1] 0.0.0.0:* LISTEN 8536/redis-server 1
[l1]默认绑定的地址以及端口
本文出自 “李群艳博客” 博客,转载请与作者联系!
redis单机搭建