Skip to content

Instantly share code, notes, and snippets.

@vickyRathee
Created May 6, 2020 13:16
Show Gist options
  • Save vickyRathee/d46ff3115cbcee212b7fedba8cd7c932 to your computer and use it in GitHub Desktop.
Save vickyRathee/d46ff3115cbcee212b7fedba8cd7c932 to your computer and use it in GitHub Desktop.
Elastic beanstalk .ebextensions config to auto install Redis
packages:
yum:
gcc-c++: []
make: []
sources:
/home/ec2-user: http://download.redis.io/releases/redis-5.0.8.tar.gz
commands:
redis_build:
command: make
cwd: /home/ec2-user/redis-5.0.8
redis_config_001:
command: sed -i -e "s/daemonize no/daemonize yes/" redis.conf
cwd: /home/ec2-user/redis-5.0.8
redis_config_002:
command: sed -i -e "s/# maxmemory <bytes>/maxmemory 100MB/" redis.conf
cwd: /home/ec2-user/redis-5.0.8
redis_config_003:
command: sed -i -e "s/# maxmemory-policy volatile-lru/maxmemory-policy allkeys-lru/" redis.conf
cwd: /home/ec2-user/redis-5.0.8
redis_config_004:
command: sed -i -e "s/protected-mode yes/protected-mode no/" redis.conf
cwd: /home/ec2-user/redis-5.0.8
redis_server:
command: src/redis-server redis.conf
cwd: /home/ec2-user/redis-5.0.8
start-redis:
command: /home/ec2-user/start-redis.sh
files:
"/home/ec2-user/start-redis.sh" :
mode: "000755"
owner: root
group: root
content: |
#!/bin/bash
cd /home/ec2-user/redis-5.0.8/src/
killall -9 redis-server
./redis-server --daemonize yes --protected-mode no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment