centos7 安装redis单实例

操作系统:CentOS 7.9
redis版本:5.0.14
主机IP:192.168.1.10

安装方式:
1)yum

yum install -y redis

2)源码安装(推荐)

step1:准备

#下载指定版本的reids
wget http://download.redis.io/releases/redis-5.0.14.tar.gz

step2:解压压缩包,并安装

#解压
tar xzf redis-5.0.14.tar.gz
cd redis-5.0.14

#编译并且安装到指定目录(/usr/local/redis)
[root@server10 redis-5.0.14]# make
[root@server10 redis-5.0.14]# make PREFIX=/usr/local/redis install

step3:初始化

[root@server10 redis-5.0.14]# ./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] /usr/local/redis/conf/redis.conf
Please select the redis log file name [/var/log/redis_6379.log] /usr/local/redis/logs/redis.log
Please select the data directory for this instance [/var/lib/redis/6379] /data/redis
Please select the redis executable path [/usr/local/redis/bin/redis-server] /usr/local/redis/bin/redis-server
Selected config:
Port           : 6379
Config file    : /usr/local/redis/conf/redis.conf
Log file       : /usr/local/redis/logs/redis.log
Data dir       : /data/redis
Executable     : /usr/local/redis/bin/redis-server
Cli Executable : /usr/local/redis/bin/redis-cli
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!

标签: linux, redis, install

评论已关闭