Skip to content

Instantly share code, notes, and snippets.

@yspb
Last active August 22, 2021 15:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save yspb/53b33f3a0e25fb98aef169921cf6c5be to your computer and use it in GitHub Desktop.
Save yspb/53b33f3a0e25fb98aef169921cf6c5be to your computer and use it in GitHub Desktop.
#make directories
mkdir /git
mkdir /db
mkdir /db/modules
mkdir /downloads
#update packages, install gcc and redis
add-apt-repository ppa:chris-lea/redis-server -y && \
apt-get update && \
apt-get upgrade -y && \
apt-get install build-essential make cmake -y && \
apt-get install redis-server -y
#install modules
cd /git
git clone https://github.com/aviggiano/redis-roaring.git
git clone https://github.com/RedisJSON/RedisJSON.git
git clone https://github.com/RediSearch/RediSearch.git
cd /git/redis-roaring
./configure.sh
cp build/libredis-roaring.so /db/modules
cd /git/RedisJSON
make
cp src/rejson.so /db/modules
cd /git/RediSearch
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
make
cp redisearch.so /db/modules
#copy config files
cd /git
git clone https://gist.github.com/8fad1c91bb5483d7cbde974fe34fc0d9.git
git clone https://gist.github.com/e54fe650687faf085da33b298514dc00.git
git clone https://gist.github.com/358babd38d9d0ce51b2862dc667c4f7a.git
git clone https://gist.github.com/14e3c1ce589319976615e6fbca294366.git
cp 8fad1c91bb5483d7cbde974fe34fc0d9/rc-local.service /etc/systemd/system/rc-local.service
cp e54fe650687faf085da33b298514dc00/rc.local /etc/rc.local
chmod 755 /etc/rc.local
chmod +x /etc/rc.local
cp 14e3c1ce589319976615e6fbca294366/redis.service /etc/systemd/system/redis.service
cat 358babd38d9d0ce51b2862dc667c4f7a/redis.conf | sed 's/node-x/'`uname -n`'/g' > /db/redis.conf
#create redis user
adduser --system --group --no-create-home redis
chown redis:redis -R /db
chmod 770 -R /db
#system services
systemctl enable rc-local
systemctl start rc-local.service
systemctl status rc-local.service
systemctl enable redis.service
systemctl start redis.service
systemctl status redis.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment