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

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

running
make distclean
and then
make
solved the issue

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.

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/

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

In linux
May be some of the files required are missing which can be installed with libc6-dev package.
This worked for me:-
Go to your redis directory and run the following in your terminal:-
sudo apt-get install libc6-dev
make distclean && make

That shouldn't be happening. One possible reason could be that your make tools are way older than current version. To update them run:
yum install make gcc gcc-c++ kernel-devel
This will install minimum packages, but if even that doesn't solves the problem, try installing the complete group:
yum install make gcc gcc-c++ kernel-devel
Read More: https://superuser.com/questions/151557/what-are-build-essential-build-dep

I guess the version 3.2.0 lost some files because I have met the same problem as you, I solved it by downloading another redis version 3.0.7, the download link is
http://download.redis.io/releases/redis-3.0.7.tar.gz
Then, decompress the file and run the command as you have done before, just step into the redis directory and type the command 'make'
Good luck with you

This error may indicate that you need to run make with sudo: sudo make
You may afterwards run into:
../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'
If so, please see:
https://github.com/antirez/redis/issues/3790

on 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
extra tips
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

You should use Ubuntu PPA
$ sudo add-apt-repository ppa:redislabs/redis
$ sudo apt-get update
$ sudo apt-get install redis

Related

Why is brew install redis not working for mac M1?

I have to install redis, but it is not working to install redis anymore using brew. Getting the following error when trying to install this way:
Warning: No available formula with the name "redis".
==> Searching for similarly named formulae and casks...
==> Casks
another-redis-desktop-manager ✔ redis-pro
jpadilla-redis redisinsight
medis
To install another-redis-desktop-manager ✔, run:
brew install --cask another-redis-desktop-manager ✔
Tried the command brew install --cask another-redis-desktop-manager.
This also didn't work.
Actually found the answer. Basically the reason for the failure in installation was because the core homebrew packages were not correctly configured.
Identified the issue with brew doctor
The solution was
rm -rf "/opt/homebrew/Library/Taps/homebrew/homebrew-core"
brew tap homebrew/core
ARM Homebrew must be installed in the /opt/homebrew directory. Earlier, you need to manually create directories and run commands. However, you do not need to manually run commands to use the latest scripts.
Direct execution:
/bin/bash -c "$(curl -fsSL https://gitee.com/ineo6/homebrew-install/raw/master/install.sh)"
PS: terminal type Run the echo $SHELL command. The command output is as follows:
/bin/bash => bash => .bash_profile
/bin/zsh => zsh => .zprofile
If you encounter invalid environment variables, you are advised to check the terminal type before setting the correct environment variables.
Starting with macOS Catalina(10.15.x), Macs use zsh as the default Shell, using.zprofile, so the corresponding command:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
If you have macOS Mojave or later and have not configured zsh yourself, use.bash_profile:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.bash_profile
eval "$(/opt/homebrew/bin/brew shellenv)"
Hope this can help you

Installing janus-gateway error on CentOS7

I want to install janus-gateway on CentOS7.
I read the following document and tried installation.
https://github.com/meetecho/janus-gateway/blob/master/README.md
git clone https://github.com/meetecho/janus-gateway.git
cd janus-gateway
sh autogen.sh
./configure --prefix=/opt/janus
However, configuring janus-gateway will cause an error. The error is as follows.
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for pkg-config... /bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for JANUS... no
configure: error: Package requirements (
glib-2.0 >= 2.34
libconfig
nice
jansson >= 2.5
libssl >= 1.0.1
libcrypto
) were not met:
No package 'nice' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables JANUS_CFLAGS
and JANUS_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
I installed libnice(libnice-0.1.3-4.el7.x86_64) in the following way.
yum install libnice
How can I solve it?
Thank you.
try this and rebuild
echo "export PKG_CONFIG_PATH=/usr/lib/pkgconfig" >> ~/.bashrc
source ~/.bashrc
Disclaimer: I am using Ubuntu 18.04 when testing this.
If you are using Ubuntu system and trying to install Janus and running this code
./configure --prefix=/opt/janus
And then getting this error: No package 'nice' found
Make sure you have been installation of the nice from aptitude.
sudo install aptitude
aptitude install libmicrohttpd-dev libjansson-dev \
libssl-dev libsrtp-dev libsofia-sip-ua-dev libglib2.0-dev \
libopus-dev libogg-dev libcurl4-openssl-dev liblua5.3-dev \
libconfig-dev pkg-config gengetopt libtool automake
For some reason installation of nice using the answer from Frank, Ahmet or Zallfire doesn't work in Ubuntu. It has to be installed using aptitude.
You should download libnice source code to install.
https://gitlab.freedesktop.org/libnice/libnice
You need the development libnice.
yum install libnice-devel

implement janus gateway for webrtc

I am following janus documentation to build a video mcu system. I installed all the dependencies of it according to the read me file.
http://janus.conf.meetecho.com/docs/
after that when I run the script using sh install.sh I am getting following error
In file included from test.c:1:0:
../websock/src/websock.h:55:26: fatal error: event2/event.h: No such file or directory
#include <event2/event.h>
^
compilation terminated.
make[1]: *** [test.o] Error 1
make[1]: Leaving directory `/home/gayan/MyDetails/MyApplications/virtualClassRoomTest/janus-gateway/wstest'
make: *** [wstest] Error 2
The installer couldn't find the libwebsock lib, which is needed for WebSockets
You can install version 1.0.4 (required!) with the following steps:
wget http://paydensutherland.com/libwebsock-1.0.4.tar.gz
tar xfv libwebsock-1.0.4.tar.gz
cd libwebsock-1.0.4
./configure --prefix=/usr && make && sudo make install
[Note: you may need to pass --libdir=/usr/lib64 to the configure script if you're installing on a x86_64 distribution]
If you're not interested in WebSockets support, you can disable them passing nowebsockets to the install script:
./install.sh nowebsockets
I also install the libwebsock according to the above steps, but still the error is showing. event2 directory is not in the janus-gateway codes. here is the github link for all the source code. https://github.com/meetecho/janus-gateway.git
Any kind of help would be appreciated.
The full installation steps to have websockets working(Ubuntu 14) are:
mkdir -p ~/build
sudo apt-get install libmicrohttpd-dev libjansson-dev libnice-dev libssl-dev libsrtp-dev libsofia-sip-ua-dev libglib2.0-dev libopus-dev libogg-dev libini-config-dev libcollection-dev libwebsockets-dev pkg-config gengetopt automake libtool doxygen graphviz git cmake
sudo apt-get install libavformat-dev
echo "Start installing libwebsockets"
cd ~/build
git clone git://git.libwebsockets.org/libwebsockets
cd libwebsockets
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DLWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT=ON ..
make && sudo make install
echo "Start installing Janus"
cd ~/build
git clone git://github.com/meetecho/janus-gateway.git
cd janus-gateway
sh autogen.sh
./configure --disable-data-channels --disable-rabbitmq --disable-docs --prefix=/opt/janus LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CFLAGS="-I/usr/local/include"
make && sudo make install
sudo make configs
Make sure to copy certificates if using wss, chrome is really picky about that stuff. If using self signed certificates you have to trust them in chrome(very intuitive procedure:)))
sudo cp mycert.pem /opt/janus/share/janus/certs/
sudo cp mycert.key /opt/janus/share/janus/certs/
I had this problem and solve it after
sudo apt-get install libevent-dev
My system is ubuntu 14.04 64 bit

PHP Fatal error: Class 'Phalcon\Script\Color' not found

I'm running Ubuntu Server 12.10 and have installed phalcon like this
sudo apt-get install php5-dev php5-mysql gcc git-core
git clone git://github.com/phalcon/cphalcon.git
cd cphalcon/build
sudo ./install
then I've added
extension=/usr/lib/php5/20100525/phalcon.so
to php.ini which located in /etc/php5/apache2/php.ini and restarted apache2. If I execute
<?php print_r(get_loaded_extensions()); ?>
I can see that the phalcon extension is loaded. Then I've installed phalcon-devtools like that
git clone git://github.com/phalcon/phalcon-devtools.git
cd phalcon-devtools
sudo ./phalcon.sh
and restarted apache2. No errors were shown during that operations, but when I'm trying to execute
phalcon commands
I get an error like this
PHP Fatal error: Class 'Phalcon\Script\Color' not found in /home/user/phalcon-devtools/phalcon.php on line 84
What I'm doing wrong?
So the problem was in php.ini for CLI, which is located in /etc/php5/cli/, after I added extension=/usr/lib/php5/20100525/phalcon.so there, I was able to use Devtools. Thanks to #NikolaosDimopoulos
Official documentation is a bit confusing so try this:
I think this is a problem of extension not loaded
After successfully compile steps:
sudo apt-get install php5-dev php5-mysql gcc git-core
git clone git https://github.com/Phalcon/cphalcon.git
cphalcon cd/build
sudo ./install
Create a new file called "30-phalcon.ini"
and within it call the extension Phalcon with this single line:
extension=phalcon.so
save the file and copy the folder "/etc/php5/apache2/conf.d /" and "/etc/php5/cli/conf.d/"
restart the server: sudo service apache2 restart
While the devtools do this:
sudo git clone https://github.com/phalcon/phalcon-devtools /var/www/devtools
then create a symbolic link to run via terminal:
1: sudo ln -s /var/www/devtools/phalcon.php /usr/bin/phalcon
2: sudo chmod ugo+x /usr/bin/phalcon
3: type "phalcon" in the terminal and see if it's work.
it should work now: D
I always install the devtools from the PEAR channel
pear channel-discover pear.phalconphp.com
pear install phalcon/Devtools
You might get an error that the Devtools are not in stable mode but (as of the time of this writing) you can use this command:
pear install phalcon/Devtools-0.5.0
Source

Apache installation; libpcre error

When installing Apache on Ubuntu 11.10, I get the following error:
configure: error: APR not found. Please read the documentation.
I followed the instructions here, then, I get the error below:
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
What am I doing wrong and how can I resolve it?
1. Download PCRE from PCRE.org
2. Compile it with a prefix and install it:
./configure --prefix=/usr/local/pcre
make
make install
3. Go back to where your Apache installation is and compile Apache with PCRE:
--with-pcre=/usr/local/pcre
For me (Fedora Linux), it was enough to just install the pcre-devel: yum install -y pcre-devel. Didn't even have to use --with-pcre afterwards.
Debian
In a clean installation of Debian 9.5, during the installation of Apache it is necessary to have some packages and libraries to avoid errors. Next I show the type of error and its respective solution
Configuration
configure: error: no acceptable C compiler found in $PATH
$ sudo apt-get install build-essential
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
$ sudo apt-get install libpcre3-dev
Then I make the configuration indicating that it is installed in the path /usr/local and not in /usr/local/apache2, otherwise I will have library errors. The idea is that the libraries created for httpd end in /usr/local/lib so that the dynamic linker knows them.
$ configure --prefix /usr/local
Compilation
And for the compilation the following the installation of some packages also would avoid us errors in a clean installation of Debian.
xml/apr_xml.c:35:19: fatal error: expat.h: No such file or directory.
$ sudo apt-get install libexpat1-dev.
It is recommended to use the -j3 parameter to make the compilation faster. Although it could also be ignored.
$ make -j3
I was other problem compiling apache2 in CentOS with pcre. I installed pcre in other location "/custom/location/pcre" and configure command throw the following error
configure: error: Did not find pcre-config script at "/custom/location/pcre"
to solve it changing the flag --with-pcre=/custom/location/pcre to --with-pcre=/custom/location/pcre/bin/pcre2-config
BTW, on CentOS 7.6 before building httpd, please install pcre-devel
`$ sudo yum install pcre-devel`
In RHEL 3 is not necessary setting parameter --with-pcre pointing to pcre-config. Only need pcre path
My configure command:
./configure --prefix=/usr/local/apache2 --with-pcre=/usr/local/pcre
This worked for me:
sudo apt-get install libpcre3-dev
In ubuntu
This worked for me
./configure --prefix /u01/apache --with-included-apr --with-pcre=/usr/local/pcre/bin/pcre2-config