redis部署报错

本文详细阐述了在部署Redis过程中遇到的两个常见问题:make[2]: cc: command not found,以及zmalloc.h:51:31: error: jemalloc/jemalloc.h: No such file or directory。作者提供了相应的解决方案,包括检查gcc缺失并安装,以及清理编译残留并重新编译。
摘要由CSDN通过智能技术生成


正常Redis部署流程

#预安装环境
[root@localhost ~]# yum -y install gcc gcc-c++ make 

#编译安装
[root@localhost ~]# tar zxvf redis-5.0.7.tar.gz -C /opt/
[root@localhost ~]# cd /opt/redis-5.0.7
[root@localhost redis-5.0.7]# make
[root@localhost redis-5.0.7]# make PREFIX=/usr/local/redis install
[root@localhost redis-5.0.7]# ln -s /usr/local/redis/bin/* /usr/local/bin/

#安装Redis
[root@localhost ~]# cd /opt/redis-5.0.7/utils/
[root@localhost 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] 
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 [/usr/local/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     : /usr/local/bin/redis-server
Cli Executable : /usr/local/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!

#配置文件
[root@localhost utils]# vim /etc/redis/6379.conf
...
bind 127.0.0.1 20.0.0.10				'//70行'
...
port 6379								'//93行'
...
daemonize yes							'//137行'
...
pidfile /var/run/redis_6379.pid			'//159行'
...
loglevel notice							'//167行'
...
logfile /var/log/redis_6379.log			'//172行'
...
[root@localhost utils]# /etc/init.d/redis_6379 restart		'//重启'

#登录Reids数据库
[root@localhost utils]# redis-cli -h 20.0.0.10 -p 6379
20.0.0.10:6379> 						'//quit退出'

一、make[2]: cc: Command not found

在这里插入图片描述

异常原因

没有安装gcc

解决方案

yum install gcc-c++

二、zmalloc.h:51:31: error: jemalloc/jemalloc.h: No such file or directory在这里插入图片描述

异常原因

一些编译依赖或原来编译遗留出现的问题

解决方案

make distclean。清理一下,然后再make。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值