Linux下源码编译安装Redis及如何后台启动Redis

操作系统:Centos

下载源码包

http://download.redis.io/releases/redis-4.0.9.tar.gz

解压

# tar -zxvf redis-4.0.9.tar.gz

编译安装

# cd redis-4.0.9

指定安装路径编译安装

# make PREFIX=/usr/local/redis install

更改配置使其后台启动

# cp redis.conf /usr/local/redis/
# cd /usr/local/redis/

修改redis.conf

# vi redis.conf

将daemonize 改为yes

    134 # By default Redis does not run as a daemon. Use 'yes' if you need it.
    135 # Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
    136 daemonize yes

指定端口运行

# bin/redis-server redis.conf --port 6379

下图即为指定端口后台运行redis


posted @ 2018-04-18 17:57  还是搬砖踏实  阅读(996)  评论(0编辑  收藏  举报