1818IP-服务器技术教程,云服务器评测推荐,服务器系统排错处理,环境搭建,攻击防护等

当前位置:首页 - Linux系统 - centos - 正文

君子好学,自强不息!

centos8安装redis

2023-02-26 | centos | 1818ip | 6108°c
A+ A-

1.下载tar包

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

解压 tar -xvf redis-5.0.5.tar.gz

cd redis-5.0.5/

2.编译源文件

编译测试 make test

最小安装服务器可能会报错:

-bash: make: command not found

安装对应服务

yum -y install gcc automake autoconf libtool make

yum install gcc gcc-c++

报出信息:You need tcl 8.5 or newer in order to run the Redis test

安装tcl

wget https://sourceforge.net/projects/tcl/files/Tcl/8.6.9/tcl8.6.9-src.tar.gz

tar -zxvf tcl8.6.9-src.tar.gz

cd tcl8.6.9/unix

./configure

make

make install

返回redis-5.0.5目录

重新执行 make test

编译 make

安装 make PREFIX=/usr/local/redis install  (安装到指定目录)

centos8安装redis

3.配置启动

cp redis.conf /usr/local/redis

cd /usr/local/redis/

mkdir log

编辑redis.conf

vim redis.conf

1.后台启动,daemonize yes

2.绑定IP,bind 192.168.XX.XXX

3.数据存放路径,dir /usr/local/redis/log rdb存放的路径

4.指定持久化方式,appendonly yes

启动:  ./bin/redis-server ./redis.conf

66790:C 11 Oct 2019 12:06:06.029 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo

66790:C 11 Oct 2019 12:06:06.029 # Redis version=5.0.5, bits=64, commit=00000000, modified=0, pid=66790, just started

66790:C 11 Oct 2019 12:06:06.029 # Configuration loaded

查看是否启动成功:

ps aux | grep redis

本文来源:1818IP

本文地址:https://www.1818ip.com/post/32903.html

免责声明:本文由用户上传,如有侵权请联系删除!

发表评论

必填

选填

选填

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。