redis单机安装

下载地址

http://download.redis.io/releases/

编译安装

make
cd src/
make install

 安装完后,在src下有redis-server服务端程序。如果不加配置文件参数,就会使用默认配置和前台启动。在redis.conf里将daemonize改成yes后,带配置文件启动。

[root@redis1-20 redis-3.0.6]# ./src/redis-server redis.conf 
[root@redis1-20 redis-3.0.6]# netstat -lntp|grep redis
tcp        0      0 0.0.0.0:6379            0.0.0.0:*               LISTEN      33400/./src/redis-s 
tcp6       0      0 :::6379                 :::*                    LISTEN      33400/./src/redis-s 

 

文件调整

redis默认的目录很乱,要调整

[root@VM_0_3_centos redis]# tree
.
|-- bin
|   |-- redis-benchmark
|   |-- redis-check-aof
|   |-- redis-check-rdb
|   |-- redis-cli
|   |-- redis-sentinel -> redis-server
|   `-- redis-server
|-- data
|-- etc
|   |-- redis12700.conf
|   |-- redis12701.conf
|   |-- redis12800.conf
|   |-- redis12801.conf
|   |-- redis12900.conf
|   |-- redis6379.conf
|   |-- redis6380.conf
|   |-- redis6400.conf
|   `-- redis.conf
`-- var
    `-- run
        `-- redis_6379.pid

  

原文地址:https://www.cnblogs.com/jabbok/p/9466891.html