Fenying

Angus’ Home.


26 Dec 2016

第九章 编译安装 Redis 服务器

本章编译安装 Redis 3.2.5 。

编译 Redis 相较前几个简单得多:

tar -zxvf redis-3.2.5.tar.gz
cd redis-3.2.5
make

即完成了编译,然后使用 Redis 自带的脚本进行安装:(中括号后面的是要输入的内容)

cd utils
./install_server.sh
Welcome to the redis service installer
This script will help you easily set up a running redis server

Please select the redis port for this instance: [6379] 6379
Please select the redis config file name [/etc/redis/6379.conf] /www/config/redis.conf
Please select the redis log file name [/var/log/redis_6379.log] /www/logs/redis.log
Please select the data directory for this instance [/var/lib/redis/6379] /www/database/redis
Please select the redis executable path [] /usr/local/redis/bin
Is this ok? Then press ENTER to go on or Ctrl-C to abort.
Copied /tmp/6379.conf => /etc/init.d/redis_6379
Installing service...
Successfully added to chkconfig!
Successfully added to runlevels 345!
Starting Redis server...
Installation successful!

这个脚本生成了一个服务文件 /etc/init.d/redis_6379,我们将只改名:

service redis_6379 stop
mv /etc/init.d/redis_6379 /etc/init.d/redis

好了,安装完毕。剩下的就是配置 Redis 了,配置文件在 /www/config/redis.conf

该文章根据 CC-BY-4.0 协议发表,转载请遵循该协议。
本文地址:https://fenying.net/book/minicentos-handbook/09.compile-redis/

comments powered by Disqus