elastic-beanstalk

Django application 504 error after saving model

与世无争的帅哥 提交于 2019-12-03 09:57:21
I have a Django website running Django 1.8 with Python 3.4 and hosted on AWS via ElasticBeanstalk. Recently, I've been having some issues with the Django admin area and 504 errors. The problem is very difficult to reproduce, it seems to happen randomly. When I save an instance of a model, sometimes the website hangs and returns a 504 error (and doesn't save). Afterwhich elasticbeanstalk restarts the server and everything works fine again. In my logs I get the following errors. End of script output before headers: wsgi.py extern "Python": function Cryptography_rand_bytes() called, but @ffi.def

AWS Elastic Beanstalk Vs EC2 Container Service (ECS) - Docker

自闭症网瘾萝莉.ら 提交于 2019-12-03 09:41:07
Have been running Docker with Elastic Beanstalk to deploy a relatively simple app, and it has been working great. Now with ECS on the horizon, I am interested to know what the differences are between the two services, and why one might use one over the other? Amazon's documentation says the following: Q: How is Amazon ECS different from AWS Elastic Beanstalk? AWS Elastic Beanstalk is an application management platform that helps customers easily deploy and scale web applications and services. It keeps the provisioning of building blocks (e.g., EC2, RDS, Elastic Load Balancing, Auto Scaling,

How do I run `npm update -g npm` on Elastic Beanstalk?

送分小仙女□ 提交于 2019-12-03 08:46:56
How can I run npm update -g npm on my Elastic Beanstalk instances as they spin up? It's fairly easy to shell into each instance to run the update command manually, but this won't work through a scaling event, as more instances are added automatically. How can i get the latest version of NPM on Elastic Beanstalk instances, in a way that works through an auto-scaling event? It turns out this one is tricky, took a bit of digging and experimentation. First, a quick bit about Elastic Beanstalk's lifecycle. There are several steps taken by AWS scripts running on each instance on deploy. For a Node

AWS Elastic Beanstalk Namecheap SSL Configuration

允我心安 提交于 2019-12-03 08:44:27
My iOS software platform runs on AWS Elastic Beanstalk and has a URL we'll call "something.elasticbeanstalk.com". I have a website we'll call "website.com" I purchased and operate the DNS records for through Namecheap. I need to make the URL my iOS client apps use to connect to the server HTTPS since Apple is requiring this soon due to App Transport Security. WHAT I THINK I'M SUPPOSED TO DO What I think I'm supposed to do is, create an SSL certificate for "website.com" and apply that SSL certificate to the AWS EB load balancer. Then I need to create a subdomain for "website.com" that redirects

Deploy war from S3 to AWS Elastic Beanstalk

扶醉桌前 提交于 2019-12-03 06:53:16
I have 2 AWS machines, 1.dev (ec2) 2. prod (elastic beanstalk) . I build and deploy on dev (machine1) after every commit which results into a war file (which will also be uploaded on an S3 bucket using s3cmd tool). Then I test the newly deployed war on dev machine, if it seems fine, then I download the war from dev(ec2) and then upload it to the prod machine (Elastic beanstalk). Is there a way to make elastic beanstalk to take the war directly from the S3 bucket, rather than downloading it from ec2 and then uploading it to elastic beanstalk? I tried creating new environment and then gave s3

Customizing an Elastic Beanstalk AMI

≯℡__Kan透↙ 提交于 2019-12-03 06:49:18
I need to use on Elastic Beanstalk a Java application written for Glassfish server. Beacuse of Amazon doesn't let me choose an AMI with Glassfish, I choosed one with Tomcat and i modified my application to work properly on Tomcat. Now, I've seen I also needed to use a Sun JDK, while by default Elastic Beanstalk AMI comes with openjdk. I googled a lot, finding some (not so many resources) interesting posts like this answer on StackOverflow What I can't understand is this part of the answer: Create your custom AMI from a running instance of Amazon's beanstalk AMI that you manually launch from

Deploying WordPress on Elastic Beanstalk?

点点圈 提交于 2019-12-03 06:48:14
Suppose I create a site in Wordpress, which is running on Elastic Beanstalk. Now, on the running app I will create posts /pages, upload images, etc. That is, some data, videos, files and records in a database will be added to the running application. 3 questions: If WordPress is running on Elastic Beanstalk with multiple Amazon EC2 instances actually running my WordPress install, then will those files propagate automatically to all running instances? And will this also happen, if a new EC2 instance is fired up - for example, to handle increased load? From what I see in AWS console, I can

Elastic Beanstalk environment variables for Docker host

匆匆过客 提交于 2019-12-03 06:03:26
I have an EB env with Docker web app (rails) properly deployed. I set several EB env variables and they are properly visible in the container. Now - I'd like these EB env variables to be visible to the EC2 instance host, so that I can use them in the docker build process. However, they are not exposed to the docker host, only to the container. How do I expose EB env variables to the Docker host? Kristopher Cargile I ran into the same issue, but needed the environment variables to be available during the execution of a post-deployment Bash script. Since the jq parser is available on the

How do I configure the name of my WSGI application on AWS Elastic Beanstalk?

泪湿孤枕 提交于 2019-12-03 05:43:42
My Python web application is called app # example.py import flask app = flask.Flask(__name__.split('.')[0]) and when I attempt to launch it on AWS-EB using # run.py (set correctly with WSGIPath) from example import app if __name__ == "__main__": app.run() I get mod_wsgi (pid=22473): Target WSGI script '/opt/python/current/app/run.py' does not contain WSGI application 'application'. How to I tell AWS that my application instance is called app ? mod_wsgi expects variable called application . Try to do something like this from example import app as application Note: don't do application.run() .

How do you call db:seed on AWS Elastic Beanstalk apps?

僤鯓⒐⒋嵵緔 提交于 2019-12-03 05:32:49
I know that you can run tasks as part of each deploy, but I only want to bootstrap the database once. Kristian's answer is close, but you should also add: container_commands: seeddb: command: 'export HOME=/root; rake db:seed' leader_only: true So that the DB is only seeded from 1 EC2 instance, rather than all of them at the same time. Depending on your EB deployment/version, the export HOME may or may not be needed. I used the information provided at this address to create a script that will run AFTER migrations and after each deploy: http://www.emind.co/how-to/how-to-run-rake-dbseed-in-amazon