Jump to content
  • 0

AWS Auto Scaling setup


Chungwei
 Share

Question

Currently I'm working on setting up auto scaling on AWS, I created the launch configuration as below:

#!/bin/bash
sudo systemctl stop apt-daily.timer

wget <ANT_MEDIA_SERVER_ENERPRISE_INSTALLER_URL>
chmod 755 install_ant-media-server.sh
sudo ./install_ant-media-server.sh ant-media-server*.zip

sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 5080
sudo iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 5443

chmod 755 change_server_mode.sh
sudo ./change_server_mode.sh cluster <MONGODB_IP>

sudo systemctl start apt-daily.timer

For some reason, it doesn't setup the cluster properly, when the AWS auto scaling initialize a new instance, however it does work if I ssh into the server and perform the command "sudo ./change_server_mode.sh cluster <MONGODB_IP>" manually.

Note that the "sudo systemctl stop apt-daily.timer" & "sudo systemctl start apt-daily.timer" commands are to solve the error that I faced earlier
Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)



Link to comment
Share on other sites

  • Answers 2
  • Created
  • Last Reply

Top Posters For This Question

Popular Days

Top Posters For This Question

2 answers to this question

Recommended Posts

 Share


×
×
  • Create New...