-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Task] should support basic (manual) autoscaling group with load balancer #327
Comments
seems we already have a load balancer - it's just not in use yet.. @amotenko - could you please link to the issue where this load balancer was added? Can I use this load balancer? Is someone else working on this? |
load balancer is called "spark-production" - seems that it's configured correctly with SSL (different certificate from production server though) - and it contains the spark-production instance |
ok, I'm going to create a new load balancer "the-real-spark-production" and use that.. |
|
userdata template#!/usr/bin/env bash
echo "
DEPLOYMENT_PACKAGE_URL="slack package url for release to deploy"
-- REST OF SPARK ENV HERE --
" > /opt/spark/.env
sudo -u ubuntu /opt/spark/deploy.sh /etc/nginx/sites-enabled/midburn-sparkserver {
listen 80 default_server;
server_name _;
location / {
proxy_pass http://127.0.0.1:3000;
}
}
server {
listen 82;
return 301 https://spark.midburn.org$request_uri;
} /opt/spark/deploy.sh#!/usr/bin/env bash
set -e # exit on errors
LOG_FILE="/var/log/spark-deploy.log"
log() {
echo `date "+%F %T "`${1} | tee -a $LOG_FILE
}
logger -stspark-deploy "started spark deployment, see log file: ${LOG_FILE}"
log "Setting up the environment..."
source /opt/spark/.nvm/nvm.sh
source /opt/spark/.env
if [ "${DEPLOYMENT_PACKAGE_URL}" == "" ]; then
log "no DEPLOYMENT_PACKAGE_URL"
exit 1
fi
log "Downloading package from ${DEPLOYMENT_PACKAGE_URL}"
curl -H "Authorization: Bearer ${SLACK_API_TOKEN}" -g "${DEPLOYMENT_PACKAGE_URL}" -o- > /opt/spark/package.tar.gz
log "Extracting..."
rm -rf /opt/spark/latest
mkdir -p /opt/spark/latest
pushd /opt/spark/latest
tar xzf /opt/spark/package.tar.gz 2>&1 | tee -a $LOG_FILE
popd
log "Copying configurations..."
cp /opt/spark/.env /opt/spark/latest/.env
log "Setting up the deployment directory..."
pushd /opt/spark/latest
nvm install 2>&1 | tee -a $LOG_FILE
nvm use 2>&1 | tee -a $LOG_FILE
ln -s node_modules/.bin/knex knex
# disabled npm run deploy - as it produces errors at the moment (doesn't seem to be needed anyway)
# npm run deploy 2>&1 | tee -a $LOG_FILE
# migrations also produce errors at the moment, should be run manually for now
# ./knex migrate:latest 2>&1 | tee -a $LOG_FILE
popd
log "starting the services"
sudo service midburn-spark start
sudo service midburn-spark status 2>&1 | tee -a $LOG_FILE
sudo service nginx start
sudo service nginx status 2>&1 | tee -a $LOG_FILE
log "DONE" |
done, see v2.2.3 |
Spark server seems overloaded and crashes, we should support autoscaling and load balancer to support fast recovery and server redundancy
This issue details the most basic requirement to improve stability in minimal time
overview of expected outcome
The text was updated successfully, but these errors were encountered: