【linux】cent7安装redis
创建目录
mkdir -p /usr/local/redis
cd /usr/local/redis
1、下载&解压
wget http://download.redis.io/releases/redis-7.4.0.tar.gz
tar -zxvf redis-7.4.0.tar.gz
2、编译
cd redis-7.4.0
make
报错:
make[3]: cc:命令未找到
安装gcc
yum install gcc-c++
清除数据
make distclean
再次编译
make
注意:如果报错
zmalloc.h:29:31: 致命错误:jemalloc/jemalloc.h:没有那个文件或目录
下载tcl:
yum install tcl
继续编译:
make
结束后再执行:
make install
安装完毕
3、配置
cp redis.conf /etc/redis6379.conf
创建日志文件:
mkdir -p /var/log/redis/log
4、启动服务并指定配置和日志
/usr/local/bin/redis-server /etc/redis6379.conf 1>/var/log/redis/log/infolog.log 2>/var/log/redis/log/errlog.log &
查询:
netstat -lantp |grep redis
5、测试
redis-cli -h localhost -p 6379
或
redis-cli
redis下载目录:
http://download.redis.io/releases/redis-7.4.0.tar.gz
引用:
https://blog.csdn.net/weixin_41858104/article/details/121736836
https://blog.csdn.net/qq_44226094/article/details/115769408