ubuntu14 下 redis 的安装

01.下载源码包

wget http://download.redis.io/releases/redis-4.0.11.tar.gz

02.解压并进入源码目录

tar -xvzf redis-4.0.11.tar.gz
cd redis-4.0.11

03.编译安装 redis ,默认将安装到 /usr/local/bin

sudo make install

如果指定安装路径,可使用 PREFIX 参数,例如:

sudo make PREFIX=/opt/redis

04.进入 utils 目录,安装控制和启动脚本

cd utils
sudo ./install_server.sh

在此期间需要设置或保持默认几个参数,如:

设置你的端口或者保持默认

Please select the redis port for this instance: [6379]

设置配置文件名或者保持默认

Please select the redis config file name [/etc/redis/6379.conf]

设置日志文件名或者保持默认

Please select the redis log file name [/var/log/redis_6379.log]

设置 数据目录 或者 保持默认

Please select the data directory for this instance [/var/lib/redis/6379]

设置 redis 可执行文件路径,一般保持默认

Please select the redis executable path [/usr/local/bin/redis-server]

05.最后它会列出配置项,没问题了回车确认

Selected config:
Port           : 6379
Config file    : /etc/redis/6379.conf
Log file       : /var/log/redis_6379.log
Data dir       : /var/lib/redis/6379
Executable     : /usr/local/bin/redis-server
Cli Executable : /usr/local/bin/redis-cli
Is this ok? Then press ENTER to go on or Ctrl-C to abort.

06.看到如下信息则安装并且启动成功。

Starting Redis server...
Installation successful!

本笔记根据 https://github.com/antirez/redis/blob/unstable/README.md 整理。

猜你喜欢

转载自blog.csdn.net/weixin_45956258/article/details/103350672