cd src && make all
make[1]: Entering directory `/root/Downloads/redis-3.2.0/src'
CC adlist.o
In file included from adlist.c:34:
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 `/root/Downloads/redis-3.2.0/src'
make: *** [all] Error 2
答案 0 :(得分:54)
运行
make distclean
然后
make
解决了问题
答案 1 :(得分:3)
由于gcc编译器在计算机中不可用而发生。首先安装gcc:
$ sudo apt install gcc
然后尝试
make
确保它将解决此问题。我尝试使用Ubuntu 18.04。
答案 2 :(得分:3)
放弃基于OS的安装,尝试了多种解决方案,但某些依赖始终失败
要救援的节点
以下步骤中还有其他安装Node和NPM的方法是在 Centos / RHEL
上使用 Yum# Add NodeSource yum repository
curl -sL https://rpm.nodesource.com/setup_10.x | sudo bash -
# Additional dependencies if required
yum install gcc-c++ make -y
# Install Node.js and npm
yum install nodejs -y
# install redis-cli
npm install -g redis-cli
# connect to redis endpoint
rdcli -h redis.host
# or
rdcli -h redis.host -a redis.password -p 1111
一次连接运行
PING
响应应该是
PONG
验证连接性
cache.amazonaws.com:6379> PING
PONG
答案 3 :(得分:1)
只有在/ deps目录中的Dependenices解析后,才会创建 redis-server 和 redis-cli 文件:hiredis lua jemalloc linenoise。 我不得不多次在deps目录中运行make命令来解决依赖关系。
以下是我遵循的步骤:
cd <redisInstallationPath> (I have it under /opt/mount1/redis-3.0.7)
make distclean
cd deps/
不止一次解决家属。
make lua hiredis linenoise
make jemalloc
make hiredis
make linenoise
再次和丢失的文件一样。我认为你只需要正确组合。不止一次运行make命令,直到你做对了。
make hiredis lua jemalloc linenoise
make hiredis
make lua
make jemalloc
make linenoise
cd /opt/mount1/redis-3.0.7/
make
- &GT;我在这里遇到了一些错误,找不到文件hiredis / libhiredis.a,因此我继续解决这些问题。
cd deps
make jemalloc
make hiredis
ll hiredis / libhiredis.a - &gt;产生一个文件
cd /opt/mount1/redis-3.0.7/
make
现在我得到以下输出:
cd src && make all
make[1]: Entering directory `/opt/mount1/redis-3.0.7/src'
LINK redis-server
INSTALL redis-sentinel
CC redis-cli.o
LINK redis-cli
CC redis-benchmark.o
LINK redis-benchmark
CC redis-check-dump.o
LINK redis-check-dump
CC redis-check-aof.o
LINK redis-check-aof
Hint: It's a good idea to run 'make test' ;)
make[1]: Leaving directory `/opt/mount1/redis-3.0.7/src'
您可以转到Redis安装路径(在我的情况下:/opt/mount1/redis-3.0.7目录)来启动服务器。
src/redis-server
在另一个终端运行&#39; redis-cli&#39;连接到Redis服务器。
src/redis-cli
示例:
127.0.0.1:6379> incr counter
(integer) 1
127.0.0.1:6379> get counter
"1"
127.0.0.1:6379> exit
我通过这篇文章http://michael.otacoo.com/redis/redis-first-steps-fetch-install-and-server-creation/
找到了解决问题的方法答案 4 :(得分:1)
在Linux中
可能缺少一些所需的文件,可以使用 libc6-dev 软件包安装
。这对我有用:-
转到您的redis目录并在终端中运行以下命令:-
sudo apt-get install libc6-dev
make distclean && make
答案 5 :(得分:0)
那不应该发生。一个可能的原因可能是您的制作工具比当前版本更旧。要更新它们,请运行:
yum install make gcc gcc-c++ kernel-devel
这将安装最少的软件包,但即使这样也无法解决问题,请尝试安装完整的组:
yum install make gcc gcc-c++ kernel-devel
阅读更多:https://superuser.com/questions/151557/what-are-build-essential-build-dep
答案 6 :(得分:0)
我想版本3.2.0丢失了一些文件,因为我遇到了和你一样的问题,我通过下载另一个redis版本3.0.7解决了它,下载链接是
http://download.redis.io/releases/redis-3.0.7.tar.gz
然后,解压缩文件并像以前一样运行命令,只需进入redis目录并输入命令&#39; make&#39;
祝你好运
答案 7 :(得分:0)
此错误可能表示您需要使用sudo运行make:sudo make
您可能会遇到:
../deps/jemalloc/lib/libjemalloc.a(nstime.o): In function nstime_get': /opt/redis_src/current/redis-stable/deps/jemalloc/src/nstime.c:120: undefined reference toclock_gettime'
答案 8 :(得分:0)
在centos上
yum install gcc glibc
tar zxvf redis-5.0.3.tar.gz
cd redis-5.0.3
cd deps
make hiredis jemalloc linenoise lua geohash-int
cd ..
make install
cd utils
./install_server.sh
其他提示
To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128