Sen descrición

Chris Mague 33f7d889bf update %!s(int64=4) %!d(string=hai) anos
ansible 3d4cc83350 change to include db files %!s(int64=4) %!d(string=hai) anos
.gitignore 33f7d889bf update %!s(int64=4) %!d(string=hai) anos
.terraform-version 0077fc9141 initial %!s(int64=5) %!d(string=hai) anos
README.md 86a61de762 update readme with reset information %!s(int64=4) %!d(string=hai) anos
inputs.tf 118fce5406 add in testing instance %!s(int64=4) %!d(string=hai) anos
maguec1.tfvars 3f246dfbcc pudate node config %!s(int64=4) %!d(string=hai) anos
main.tf 33f7d889bf update %!s(int64=4) %!d(string=hai) anos
raft_group_setup.tpl f2b6e2ac94 add in better setups of twem %!s(int64=4) %!d(string=hai) anos
variables.tf 118fce5406 add in testing instance %!s(int64=4) %!d(string=hai) anos

README.md

Example of calling modules to build an RE environment

Prerequisites

  • aws-cli
  • tfenv
  • ansible

Generate Key Pair

aws ec2 create-key-pair --profile redislabs --key-name maguec1 --region us-west-1 \
| jq .KeyMaterial |  awk '{gsub(/\\n/,"\n")}1' | \
sed -e s/\"//g >> ~/.ssh/maguec1.pem

chmod 0600 ~/.ssh/maguec1.pem

After ansible

# download roles
cd ansible && rm -rf roles/* && ansible-galaxy install --roles-path roles -r requirements.yml
ansible-playbook ansible/cp_nodes.yml --private-key ~/.ssh/maguec1.pem -i inventories/maguec1_all_nodes.ini
ansible-playbook ansible/test_nodes.yml --private-key ~/.ssh/maguec1.pem -i inventories/tester.ini 

Resetting

On each node run:

for i in 1990{1..9} 1991{0..2}; do   sudo systemctl daemon-reload;   sudo systemctl stop redis-${i};   sudo rm -rf /redis/persistant/cpredis/199*.*;   sudo truncate -s 0 /var/log/cpredis/*.log;   sudo systemctl start redis-${i}; done

On node1 run:

~/raft_group_setup_3 or _5 dependin on the size

On the tester node to reset the twemproxy:

 sudo systemctl stop twemproxy-template.service && sudo systemctl stop twemproxy && sudo rm -rf /etc/nutcracker.yml && sudo systemctl start twemproxy-template.service