Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Building and Loading the ReJSON Module on Linux Ubuntu 16.04 for Redis

make sure you have at least redis v4.0+

redis-server --version

redis-cli --version

install the build-essential package

apt-get install build-essential


git clone https://github.com/RedisLabsModules/rejson.git

cd rejson/

make

cd src/

mkdir /etc/redis/modules/

mv rejson.so /etc/redis/modules/

add this line to /etc/redis/redis.conf

loadmodule /etc/redis/modules/rejson.so

restart redis server

service redis-server restart

--

ref: https://oss.redislabs.com/rejson/#linux-ubuntu-1604

@nateGeorge

This comment has been minimized.

Copy link

nateGeorge commented Jan 30, 2019

lifesaver

@CaypoH

This comment has been minimized.

Copy link

CaypoH commented Mar 15, 2019

For CentOS:

UPDATING AND INSTALLING PACKAGES

yum update -y
yum install epel-release yum-utils -y
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm -y
yum-config-manager --enable remi
yum install redis git -y

SETTING VARIABLES

REJSON_MODULES=$(rpm -ql redis | grep modules)  # default: /usr/lib64/redis/modules
REDIS_CONF=$(rpm -ql redis | grep "redis.conf$")  # default: /etc/redis.conf
HOST_IP=$(ip addr show eth0 | grep -Po "inet \K[\d.]+")

INSTALLING REJSON MODULE

cd /usr/src
git clone https://github.com/RedisLabsModules/rejson.git
cd rejson/
make
cp src/rejson.so ${REJSON_MODULES}
chown redis:redis ${REJSON_MODULES}/rejson.so
chmod 750 ${REJSON_MODULES}/rejson.so

CHANGING CONFIGURATION AND STARTING REDIS

sed -i "/MODULES/a loadmodule ${REJSON_MODULES}/rejson.so" ${REDIS_CONF}
sed -i "s/bind 127.0.0.1/bind ${HOST_IP}/g" ${REDIS_CONF}  # remove this line if you dont want redis server to be accessible from outside
systemctl start redis
systemctl enable redis

@p3t3r67x0

This comment has been minimized.

Copy link

p3t3r67x0 commented Dec 24, 2019

Thank you so much for posting it here on Gist!

@GuyG-Saha

This comment has been minimized.

Copy link

GuyG-Saha commented Feb 6, 2020

Hi,

I ran into a severe problem today while trying to load this module.
After adding the line loadmodule /etc/redis/modules/rejson.so to redis.conf file (below other lines that started with loadmodule) and restarting the redis-server I found out that almost all my data got deleted. It was saved before and somehow only 3 keys were loaded this time.

I'm using Ubuntu 18.04 WSL (in Windows 10 PowerShell).

Can you please check whether it's a bug or tell if I did anything wrong?

@ghothan

This comment has been minimized.

Copy link

ghothan commented Apr 28, 2020

I keep getting this error when I run make

ubuntu@ip-10-53-10-226:~/rejson$ make
make -C ./src all
make[1]: Entering directory '/home/ubuntu/rejson/src'
make[1]: *** No rule to make target 'all'. Stop.
make[1]: Leaving directory '/home/ubuntu/rejson/src'
Makefile:2: recipe for target 'all' failed
make: *** [all] Error 2

Is there something wrong with my make command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.