elastic-beanstalk interview questions
Top elastic-beanstalk frequently asked interview questions
I would like to know if there is a way to setup a cronjob/task to execute every minute. Currently any of my instances should be able to run this task.
This is what I have tried to do in the config files without success:
container_commands:
01cronjobs:
command: echo "*/1 * * * * root php /etc/httpd/myscript.php"
I'm not really sure if this is the correct way to do it
Any ideas?
Source: (StackOverflow)
What are the advantages we get by using Elastic Beanstalk over maually creating EC2 instance and setting up tomcat server and deploy etc for a typical java web applicaion. Are load balancing, Monitoring and autoscaling the only advantages?
Suppose for my web application which uses database I installed the database in the EC2 instance itself. When Autoscalling takes place will the database gets created in the newly created instance or it will be accessing the database I created in the master instance... If it creates just a replica when autoscaling happens how will be data sync happens between the instances?
Source: (StackOverflow)
The Amazon Elastic Beanstalk blurb says:
Elastic Beanstalk lets you "open the hood" and retain full control ... even pass environment variables through the Elastic Beanstalk console.
http://aws.amazon.com/elasticbeanstalk/
How to pass other environment variables besides the one in the Elastic Beanstalk configuration?
Source: (StackOverflow)
As far as I understand AWS Elastic Beanstalk will allow you to set auto-scaling, which means that you can use a micro-instance overnight, say, and auto-scale up during the day. Can you still take advantage of reserved EC2 instance pricing if you do this?
Source: (StackOverflow)
I am launching a django application on aws elastic beanstalk. I'd like to run background task or worker in order order to run celery.
I can not find if it is possible or not. If yes how it could be achieve.
Here is what I am doing right now but this is producing every time an event type error.
container_commands:
01_syncdb:
command: "django-admin.py syncdb --noinput"
leader_only: true
50_sqs_email:
command: "./manage.py celery worker --loglevel=info"
leader_only: true
Thanks for the help,
Source: (StackOverflow)
I just signed up for Amazon's new Elastic Beanstalk offering and loving it. What I can't figure out is how to SSH to a Beanstalk instance. I don't have a private key because Beanstalk generated the instance on my behalf. Ideas?
Thanks,
Benno
Source: (StackOverflow)
I have an Elastic Beanstalk app and environment already setup. I've just downloaded the Dev Tools CLI/eb on Windows, and would like to use eb
to push to said environment.
If I use eb init
, I have to create a new EB app and environment.
How do I initialize the git repo to an existing EB app and environment?
Source: (StackOverflow)
I would like to switch of Elastic Load Balancer (ELB) for my Elastic Beanstalk environment.
Currently I don't need it and I don't want to pay for it.
It is possible to delete the ELB in EC2 managment window but then Elastic Beanstalk health state is switched from GREEN to RED.
I just found a information that it's not possible.
Does someone has a trick how to run Elastic Beanstalk without load balancing and have environment GREEN health state?
Source: (StackOverflow)
I've been trying for several days now to set up Django under Amazon Web Services' Elastic Beanstalk. I think the problem I'm hitting is this one:
ERROR - Your WSGIPath refers to a file that does not exist.
I followed the tutorial here and all goes well until the end of Step 6, but I can't for the life of me get anything to display other than the generic Elastic Beanstalk page from Step 5, #2. When I run
./manage.py runserver
on my local machine, everything works as it should, but I can't get that page to deploy. I first tried with a small Django site I wrote myself. It didn't work, so I deleted everything I'd done and tried again, that didn't work, so I deleted all that and tried again with a fresh django install. I tried that a bunch of times fiddling with little things, but I think I'm missing something major.
I added a python.config file as described in this tutorial.
Here's my file structure:
-.git/
-.mysite/
-myapp/
-__init__.py
-models.py
-tests.py
-views.py
-mysite/
-__init__.py
-settings.py
-urls.py
-wsgi.py
-.ebextensions/
-python.config
-manage.py
-mysite.db
-requirements.txt
From my settings.py:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'mysite.db',
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '',
}
}
Here's python.config:
container_commands: 01_syncdb:
command: "django-admin.py syncdb --noinput"
leader_only: true
option_settings:
- namespace: aws:elasticbeanstalk:container:python
option_name: WSGIPath
value: mysite/wsgi.py
- option_name: DJANGO_SETTINGS_MODULE
value: mysite.settings
- option_name: AWS_SECRET_KEY
value: <This is my secret key>
- option_name: AWS_ACCESS_KEY_ID
value: <This is my access key>
Is there another place I need to define my WSGIPath? Is there a way to do it through the AWS console? Should I just skip EB altogether and use EC2 directly?
Source: (StackOverflow)
Amazon Beanstalk installs node and npm into really obscure places - and I'm not sure they won't change if EB decides to use a newer version of node, which would cause my application to break.
These are the locations for node and npm:
/opt/elasticbeanstalk/node-install/node-v0.8.24-linux-x64/bin/node
/opt/elasticbeanstalk/node-install/node-v0.8.24-linux-x64/bin/npm
I'm worried about the 0.8.24
part changing and I'd rather not grep for things in cron or monit scripts when trying to find something that is normally just /usr/bin/XXX
.
how do I get a consistent filepath for these executables? and why does EB do this?
for reference, I tried setting the NodeVersion
option in an .ebextensions/app.config
, it had no effect on the install location.
Source: (StackOverflow)
I'm trying upload my project (in python) that uses Psycopg2 for Amazon Elastic Beanstalk. I'm doing this with a zip file containing my project and an requirements.txt file.
But I'm receiving this error:
Downloading/unpacking psycopg2>=2.4.6 (from -r
/opt/python/ondeck/app/requirements.txt (line 3)) Running setup.py
egg_info for package psycopg2
Error: pg_config executable not found.
Please add the directory containing pg_config to the PATH
or specify the full executable path with the option:
python setup.py build_ext --pg-config /path/to/pg_config build ...
or with the pg_config option in 'setup.cfg'.
Complete output from command python setup.py egg_info:
running egg_info
How can I solve this on Amazon?
Source: (StackOverflow)
Is there a CLI utility for tailing logs from Elastic Beanstalk applications. Specifically a python flask application.
You can use their eb CLI to get a snap shot ...
eb logs
But I would like to do (similar to what heroku offers)...
eb logs --tail
Has any one accomplished this?
Thanks!
Some references:
Source: (StackOverflow)
I have set up a RoR environement on AWS' elastic beanstalk. I am able to ssh into my EC2 instance.
My home directory is /home/ec2-user, which is effectively empty.
If I move up a directory, there is also a /home/webapp directory that i do not have access to.
Is there a way to run a rake command or rails console on my elastic beanstalk instance?
If I type rails console I get Usage: rails new APP_PATH [options]
If I type RAILS_ENV=production bundle exec rails console, I get "Could not locate Gemfile
"
Source: (StackOverflow)
I have a PHP application deployed to Amazon Elastic Beanstalk. But I notice a problem that every time I push my code changes via git aws.push to the Elastic Beanstalk, the application deployed didn't picked up the changes. I checked the events log on my application Beanstalk environment and notice that every time the Beanstalk issues:
Deploying new version to instance(s)
it's always followed by:
The following instances have not responded in the allowed command timeout time (they might still finish eventually on their own):
[i-d5xxxxx]
The same thing happens when I try to request snapshot logs. The Beanstalk issues:
requestEnvironmentInfo is starting
then after a few minutes it's again followed by:
The following instances have not responded in the allowed command timeout time (they might still finish eventually on their own): [i-d5xxxxx].
Has anyone had any similar experience? Any ideas or pointers would be greatly appreciated.
Source: (StackOverflow)
My understanding of Elastic Beanstalk is that when you deploy a new version of your app, that it deploys it to the Amazon EC2 instances one at a time (if you have more than one). However, even with a minimum of two instances, my application incurs a short amount of downtime when I upload a new .war
when it is deploying it, as if it is updating them both simultaneously. Is there a way I can ensure there is no downtime and that one instance is fully updated and accepting requests before the next starts: Here is how the events look. Note this is with zero load on the app, so it will only get worse with production traffic.
INFO
Environment update completed successfully.
INFO
New application version was deployed to running EC2 instances.
ERROR
The application did not respond at the health check URL.
INFO
Waiting for 8 seconds while EC2 instances download the updated application version.
INFO
Deploying version SomethingMore to 2 instance(s).
Source: (StackOverflow)