Centos7安装Redis
· 技术积累 · Redis

centos7下安装redis

下载:redis-3.2.3

wget http://download.redis.io/releases/redis-3.2.3.tar.gz
tar -xf redis-3.2.3.tar.gz
cd redis-3.2.3
make
make install
cd utils
./install_server.sh

Centos7安装Redis

如果redis make 出错:

zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory
zmalloc.h:55:2: error: #error "Newer version of jemalloc required"
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory `/data0/src/redis-2.6.2/src'
make: *** [all] Error 2

解决:

wget http://www.canonware.com/download/jemalloc/jemalloc-3.3.0.tar.bz2
或者本站下载:
wget https://www.jinchuang.org/novel/lnmp/jemalloc-3.3.0.tar.bz2
tar jxvf jemalloc-3.3.0.tar.bz2 
cd jemalloc-3.3.0
./configure
make && make install
再进入redis安装目录 进行make 操作,make clean 或者 删除解压目录从新解压

redis 安装后配置文件默认在 /etc/redis/6379.conf
由于/etc/init.d/ 下面redis启动脚本名称为redis_6379 我这里改下文件名称方便操作

cd /etc/init.d/
mv redis_6379 redis

启动redis
service redis start

停止redis
service redis stop

考虑到安全性,我们需要启用redis的密码验证功能requirepass参数 (可选)

vim /etc/redis/6379.conf
requirepass 修改为自定义的密码;

Centos7安装Redis

然后重启redis生效


本文最后更新时间 2023-12-12
文章链接地址:
https://me.jinchuang.org/archives/26.html
本站文章除注明[转载|引用],均为本站原创内容,转载前请注明出处
Redis6.0.6集群 删除节点
Redis6.0.6集群 增加节点
Centos7 Redis6.0.6版本集群搭建
Redis 一站式管理平台工具,支持集群创建、管理、监控、报警

Nginx http跳转https 80端口跳转433

php7安装redis扩展

我要留言