Centos7单机安装Redis

Redis Centos7单机安装

英文官网 https://redis.io/
中文官网:http://redis.cn/
源码安装:
版本是redis 5.0.5

下载、解压、编译Redis

$ wget http://download.redis.io/releases/redis-5.0.5.tar.gz
$ tar xzf redis-5.0.5.tar.gz
$ cd redis-5.0.5
$ make

如果报错 升级gcc
yum -y install gcc
yum -y install centos-release-scl

编译失败后,需要清除后 才能再次编译
make distclean

redis 实例 安装

make install PREFIX=/opt/zyt/redis5
vi etc/profile
添加
export REDIS_HOME=/opt/zyt/redis5
export PATH=REDIS_HOME/bin:$PATH
source /etc/profile

一个物理机可以有多个redis实例(进程) 通过port 区分
可执行程序就一份在目录,但在内存中未来的多个实例需要各自的配置文件,持久化目标等资源
通过 install_server.sh 进行实例安装

cd /zyt/redis5/utils
./install_server.sh
Please select the redis port for this instance: [6379]
Selecting default: 6379
Please select the redis config file name [/etc/redis/6379.conf]
Selected default - /etc/redis/6379.conf
Please select the redis log file name [/var/log/redis_6379.log]
Selected default - /var/log/redis_6379.log
Please select the data directory for this instance [/var/lib/redis/6379]
Selected default - /var/lib/redis/6379
Please select the redis executable path [/opt/zyt/redis5/bin/redis-server]
Selected config:
Port : 6379
Config file : /etc/redis/6379.conf
Log file : /var/log/redis_6379.log
Data dir : /var/lib/redis/6379
Executable : /opt/zyt/redis5/bin/redis-server
Cli Executable : /opt/zyt/redis5/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!

查看 实例 运行状态/etc/init.d 存放的可执行 程序
service redis_6379 status/start/stop > /etc/init.d/redis_6379

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值