Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redis Installation fails with "Newer version of jemalloc required" when running make command

Tags:

redis

jemalloc

Redis installation on RHEL fails when running make command. Below is the output

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
like image 265
Vijay Avatar asked May 08 '16 17:05

Vijay


People also ask

What is Jemalloc Redis?

Jemalloc is our memory allocator, used as replacement for libc malloc on Linux by default. It has good performances and excellent fragmentation behavior. This component is upgraded from time to time. hiredis is the official C client library for Redis. It is used by redis-cli, redis-benchmark and Redis Sentinel.


4 Answers

running

make distclean

and then

make

solved the issue

like image 176
Vijay Avatar answered Oct 12 '22 02:10

Vijay


It happen due to gcc compiler not available in machine. first install gcc:

$ sudo apt install gcc

then try

make

sure it'll resolve this issue . I tried on ubuntu 18.04.

like image 30
manendra Avatar answered Oct 12 '22 02:10

manendra


Redis creates the redis-server and redis-cli files only after the Dependenices in the /deps directory: hiredis lua jemalloc linenoise are resolved. I had to run the make command in the deps directory more than once to get the depenedencies resolved.

The following are the Steps I followed:

cd <redisInstallationPath> (I have it under /opt/mount1/redis-3.0.7)
make distclean
cd deps/

Resolve dependecies more than once.

make lua hiredis linenoise
make jemalloc
make hiredis
make linenoise

Did the same again as there were a few missing files. I think you just need to get the combination correct. Run the make command more than once till you get it right.

make hiredis lua jemalloc linenoise
make hiredis
make lua 
make jemalloc 
make linenoise

cd /opt/mount1/redis-3.0.7/
make

-> I got some errors here that the file hiredis/libhiredis.a is not found and hence I continued again to resolve dependecies.

cd deps
make jemalloc 
make hiredis

ll hiredis/libhiredis.a -> yields a file

cd /opt/mount1/redis-3.0.7/
make

Now I get the following output:

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'

You can go to Redis installation path (in my case: /opt/mount1/redis-3.0.7 directory) to start the Server.

src/redis-server

And in another terminal run 'redis-cli' to connect to the Redis Server.

src/redis-cli

Example:

127.0.0.1:6379> incr counter
(integer) 1
127.0.0.1:6379> get counter
"1"
127.0.0.1:6379> exit

I got a solution to my problem through this article http://michael.otacoo.com/redis/redis-first-steps-fetch-install-and-server-creation/

like image 30
Rakesh Venkat Avatar answered Oct 12 '22 00:10

Rakesh Venkat


Ditch the OS based installation, tried multiple solutions some dependency was always failing

Node to the rescue

There are other ways to install Node and NPM below steps is using Yum on Centos / RHEL

# Add NodeSource yum repository
curl -sL https://rpm.nodesource.com/setup_16.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

once connected run

PING

response should be

PONG

to validate the connectivity

cache.amazonaws.com:6379> PING
PONG
like image 3
Kishore Venkataramanan Avatar answered Oct 12 '22 01:10

Kishore Venkataramanan