#347 Rubber and Amazon EC2
Deploying to Amazon EC2 allows you to scale an application quickly. Learn how to use Rubber to deploy to the cloud with just a few commands and monitor the cluster with various web tools.
- Download:
- source code
- mp4
- m4v
- webm
- ogv
Excellent episode, thank you
That was one of the best episodes yet. Thank you so much.
Nice episode, but I have a simple question. How can I add a Faye server (or any other independent server) to the application?
Thanks,
Andrei
The best way would be to add a rubber template to the mix. You can check out the existing templates here: https://github.com/wr0ngway/rubber/tree/master/templates
Another method would be to simply spin up a server with rubber, ssh in and setup faye manually.
Thanks for the reply. It might sound silly, but can you access the server via ssh? I haven't tried it yet, but I am considering moving my application to EC2.
Thanks again.
I haven't watched the episode yet but I wouldn't see why not. SSH is standard for any linux setup I've worked with. Also typically Capistrano uses it for tunneling.
Yea! That's my favorite part of rubber, it doesn't abstract anything away from you.
tunneling in, use your ec2 keypair and ssh root@name, i.e.: ssh -i ~/.ec2/gsg-keypair root@app01.foo.com
Once you're in, you can find all your config files where they're supposed to be or your app in the /mnt directory.
Hey, Ryan, thanks for the episode!
This may be a silly question, but does rubber also install all we need in the EC2 to deploy?
Thanks in advance.
Yes. Rubber hooks into capistrano and installs all the packages that are needed for the given template. Adding more aptitude packages is easy and all contained within the Rubber config files.
Wow, that's really sweet.
Thanks for the help.
Awesome!
Sorry if this is a noobish question, but why is the application being split into web, app, and db instances? I don't really understand that part. Is that just for Amazon or cloud-based load balancing, or is that something that I should be doing on a VPS? Thanks
splitting up the web app and db instances in rubber is more about how Rubber handles 'roles'. There can also be a redis role, a resque role, a sphinx role etc. It allows rubber to be very modular and scalable. You can place different roles on different hardware for instance.
Okay, thanks Scott.
Thanks Brian, for breaking the noobish question ice. Here's another one: Would anybody care to weigh in on the pros & cons of this EC2 service vs. using a VPS? Or maybe offer a link to an article that hits this question?
Thanks everybody and thanks again Ryan.
This is a big topic.
The simple aspect that my experience lends is just a very scalable system. With rubber, I have roles for each aspect of my application and spinning up a new server to handle more application resources takes minutes. Interfacing ec2's with other amazon services is ridiculously easy. Scaling horizontally and vertically is simplified especially with tools like Rubber.
I've been using Rubber for a bit over a year now and absolutely love it. Version 2.0 is a huge improvement as well.
Do you have experience with installing RMagick with Rubber on an instance? What is the best way to do it? I can simply ssh to the instance and install it manually, but it doesn't feel right.
There's a much better way.
First off, make sure you have rmagick in your gemfile.
Then in your rubber.yml file there should be a setting for 'packages'. Somewhere around line 189. You can simply add aptitude packages in this array.
Add to the array, 'imagemagick' and possibly libmagick9-dev. Simply cap rubber:bootstrap your instance and it will install these packages for you along with the new gem in your gemfile. Paperclip and other image processing should be good to go.
Also. There's a wealth of rubber information on the google discussion group from the last few years. http://groups.google.com/group/rubber-ec2
Note, you can also install packages on a template by template basis. Like only installing imagemagick when you are using passenger etc. The rubber.yml packages line will install it on all your severs.
Thank you very much, Scott!
I had to add "libmagickwand-dev" as well to make it work.
Rubber seems to be a really great tool :)
'libmagick9-dev' is no longer available, adding 'imagemagick, libmagickwand-dev' to packages: in rubber.yml is worked for me.
Ill add another new question re rubber.
If you start of with a small app so only one server required for all roles how well does rubber handle breaking this up once hopefully you start to get bigger. ie creating separate roes for App, Web & DB.
Would you have to convert your existing role to be just DB??
Also what about auto scaling. Is there a way to have rubber auto scale app and db slave servers if required?
And one more to chuck in what about setting up staging environment?
But like Alexander has said this seems a great tool.
I've done all these things in the past year so I'll pitch in.
The best part of using ec2's is you can get your servers to a stateless point. Where you can drop your existing servers at the drop of the hat if they have redundancies.
If you were to have a web, app, db server. to split that up you'd start by setting up a new db server where it's solely db and dump your current db over there. I personally love using RDS so I always have a separate db setup to host and I never have to worry about it. Alternatively, you could setup a slave on a separate server and then promote it later.
You can then set up more separate app servers, which become part of the network so they'll be managing some load but still working with the web role on the original server.
Finally, you can pull out the web role into it's own and the two web servers will work fine and you can drop one seamlessly.
Auto scaling is a bit different. Amazon does have ways of flashing your current image and they'll start up a new one if certain requirements are met. I haven't played with this as much. As long as you're paying attention, you can scale yourself really quickly in rubber without any new configuratio.
Staging environment is just like any rails env. set up a new staging.rb file in the environments and when you do cap rubber:create_staging, prefix it with RUBBER_ENV=staging cap rubber:create_staging so it setups up an entire rubber configuration within that environment. Separates out the instance yaml's and everything.
Thanks Scott, Going to give rubber a go I recon.
I'm just starting to look at rubber, but it looks like it's doing much of what I was building by hand. Can you share how you configured it to work with RDS?
Hi Scott.
I need to install Libsndfile as a binary instance... How is that done, do you know?
Thank you for this very nice cast. Rubber is impressive and makes great use of Capistrano's power. Can it handle non-rails applications and other cloud providers (I am guessing no and no)?
Hi. I'm one of the rubber devs. It can handle non-Rails applications just fine. I've personally deployed a couple Sinatra apps with in. And I even use Rubber to manage a few servers that just run Java apps and quite a few Windows machines on EC 2 (note that Rubber can only create/destroy/reboot Windows -- no app deploy).
It is currently EC 2 only. Part of the rubber 2 revamp was to base it on fog, which opens up the opportunity to run on a lot more providers. But, as of yet, we haven't done the work to finish this up. It's on the docket though.
Very nice! Looking forward to the upcoming releases.
NOOB - when I'm creating the EC2 instance, Amazon wants me to select a AMI (stack). Which one do you select?
Rubber should handle this for you. By default, the current version of rubber (2.0.1) uses ami-3c994355, which corresponds to the 64-bit instance-store Ubuntu 12.04 LTS image.
Feel free to hop onto #rubberec2 on Freenode and I'll try to help out.
AMI code for a kind of Image is different in each region, for example:
Ubuntu 12.04 LTS
Singapore:
64 bit: ami-a4ca8df6, 32 bit: ami-a6ca8df4
Northern Virginia:
64 bit: ami-a29943cb, 32 bit: ami-ac9943c5
I got the codes when i try to launch a new instance from AWS console and copy it. But maybe there's a better way to get it :)
NOOB - Getting error
* executing "sudo -p 'sudo password: ' bash -l -c 'cp /home/ubuntu/.ssh/authorized_keys /root/.ssh/'"
servers: ["50.17.145.140"]
.. ** Failed to connect to 50.17.145.140, retrying
* executing `rubber:_allow_root_ssh'
I believe my credentials are correct.
If I look at the EC2 console it says the private ip is 10.111.63.18
You'll get these for a bit. There's a delay between when Amazon indicates the machine is available and when we can actually SSH into it. If it doesn't resolve itself after a few minutes, then something is wrong. But if you only see them for a couple minutes, it's nothing to worry about. EC2 is pretty variable about instance startup time.
Yeah I have the same problem despite the instance being available. I'm able to ssh to it.
I was using a previous aws key-pair and for some reason creating one named gsg-keypair fixed the problem.
+1. Just hang in there. I was getting nervous because the server had actually been running (green light in the UI) on AWS for awhile. It did eventually kick in.
First check if your private key is in ~/.ec2 directory.
After, try to remove the .pem extension from your private key file.
+1
Once again, you read my mind with this week's episode topics! Thanks a ton Ryan, keep up the great work.
Thanks a lot Ryan! This episode is just amazing! I was looking for a tutorial like this for months!
Thank you, just what i was looking for.
Thanks, great cast, and just in time for me.
When I configure AMI for us-east-1 things seems to work. But if I change the aws: to region: eu-west-1 even the staging fails with a AMI ID '' does not exist. Any ideas how to solve this? Also what shall I specify for time zone instead of US/Eastern
The AMIs only work in the region they were created in. If you want to use us-west-1 with Ubuntu 12.04, the AMI you want is ami-e7712aa2.
Check out the sidebar on http://alestic.com/ to get a listing of Ubuntu AMIs by region and type.
The timezone setting is just the standard set of timezone mappings from Ubuntu. If you're on the west coast, I guess "America/Vancouver" would do what you want.
As I am in Europe! I would like to use eu-west-1. I can't get that to work. If I simply switch to us-east-1 it works. Why is that?
Please hop on the rubber user list [1] and I'll try to help you out there. Sorry, I misread what you typed earlier as us-west-1. The eu-west-1 AMI is ami-1de8d369 (again, taken from http://alestic.com/).
[1] -- http://groups.google.com/group/rubber-ec2
Kevin, the last time i checked, AMI for eu-west-1 for Ubuntu 12.04 LTS 64 bit is ami-e1e8d395 and 32 bit is ami-e7e8d393 :)
What kind of cost could I expect for a small site with say between 100 and 500 hits per day? Would it work out cheaper than a linode vps in this case?
I would like to know how to match my own domain name instead of foo.com.
Thanks.
Modify the "domain" setting in config/rubber/rubber.yml.
how do i point the domain to ec2?? just linking the ip or do i need to set up an extra dns server??
You don't need DNS out of the box since rubber will write your host entries to /etc/hosts. But if you do want DNS, rubber can manage that as well. Look at the config/rubber/rubber-dns.yml template to get started.
@robbied72, for the first year, it'd be much cheaper, since you can most likely get away with the Amazon free tier, which gives you a micro instance free for a year.
Thanks Brian, will give it a shot.
How to config rubber to utilize the free tier? In rubber.yml it seems you can only choose between m1.small not m1.micro
Sorry, that comment in config/rubber/rubber.yml is misleading. You can use any instance type. Although "m1.micro" doesn't exist -- it's "t1.micro".
sorry about the t :-)
When using m1.small things work great. But when using t1.micro the web role server fails miserably on bootstrap. Hangs while doing rubber config. Cant't go beyond the transforming collectd.conf. Any ideas?
No worries. It's kinda hard to really try to debug what's going on here. Mind joining the mailing list and asking there?
http://groups.google.com/group/rubber-ec2
Thanks.
I did, but I don't see my message there !?
msg below:
Hi I have been trying to use the t1.micro image_type on eu-west-1, using the ami-e1e8d395. I can create and bootstrap and even deploy app role servers and db role servers. But unable to even bootstrap the web role server.
It gets stuck while running ./script/rubber config is being run. If I ssh to the server the rvm process is a zombie. If I kill it and run locally I get the same result. Below is what I get when running:
FILTER=web01 cap rubber:booystrap
lots of stuff...
** [out :: web01.foo.com] Resolving deltas: 100% (58/58), done.
command finished in 200394ms
triggering after callbacks for
deploy:update_code'
rubber:passenger:remove_config_ru'* executing
** No servers for task remove_config_ru, skipping
* executing "sudo -p 'sudo password: ' bash -l -c 'cd /mnt/fz-
production/releases/20120508214814 && RUBBER_ENV=production RAILS_ENV=production ./script/rubber config --force --file=\"role/ collectd\"'"
servers: ["web01.foo.com"]
[web01.foo.com] executing command
** [out :: web01.foo.com] Rubber[INFO]: Transforming /mnt/foo- production/releases/20120508214814/config/rubber/role/collectd/
collectd-ping.conf
** [out :: web01.foo.com] Rubber[INFO]: Transforming /mnt/foo- production/releases/20120508214814/config/rubber/role/collectd/
collectd.conf
How to solve this?
I switched to us-east-1 and changed AMI accordingly. Guess what, It worked on the first attempt. I tried the eu-west-1 numerous times but always getting stuck at the above. Strange! The only explanation I can think of is that the AMIs aren't identical.
I used:
ami-a29943cb for us-east-1
ami-e1e8d395 for eu-west-1
In the EU setup all servers ended up in eu-west-1a (as there are 1a, 1b, 1c) so that cannot be the issue.
Sorry. The list is moderated because Google Groups is a spam haven. Your message has gone through now.
I've actually run into a similar problem. Rubber blows up toward the end, with:
So, now, I'm off to join the mailing list. ;-)
Hi!
Is haproxy required for the web role? Put another way, can I use nginx/apache + passenger for the web role skipping haproxy altogether?
Thx!
rb
Rubber generates config into your project. By default we set up HAProxy, but you're welcome to delete that and reconfigure the web server ports. I do that currently: I have apache listen on 80 & 443 and use mod_cluster to some TorqueBox servers.
Kevin, do you have anything you could point me to as far as blog posts or documentation on how you went about setting up torquebox on EC2? I've fallen in love with torquebox in the last couple days and I want my ultimate destination to be EC2. It would be nice to use Rubber to help manage this. I see you've created a torquebox template, I'm just wondering if you have any documentation on how you've used it and how well it has worked for you. Thanks!
EC2 comes with Elastic Load Balancing, it would be nice to use it instead of a web role.
Is it feasible ?
Noob getting this error
** [out :: production.genlink.com] rake aborted!
** [out :: production.genlink.com]
** [out :: production.genlink.com] FATAL: role "GenLink" does not exist
** [out :: production.genlink.com]
** [out :: production.genlink.com] Tasks: TOP => environment
** [out :: production.genlink.com]
** out :: production.genlink.com
** [out :: production.genlink.com]
command finished in 16651ms
failed: "/bin/bash -l -c 'cd /mnt/GenLink-production/releases/20120509093404 && bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile'" on production.genlink.com
It's really hard to provide support here. If you wouldn't mind, please ask the question on the mailing list:
http://groups.google.com/group/rubber-ec2
It looks like your role configs might have gotten out of whack. But, hard to to say with just that snippet.
How does rubber handle adding an extra database instance? Does it automatically copy over the data and add itself as a slave?
Additionally, does the standard rubber config offer failover or would I need to add this in?
It's really up to you. But we handle the single master, multiple slave setup out of the box for both PostgreSQL and MySQL. All you need to do is add a machine with the appropriate slave role (e.g., postgresql_slave) and it'll auto-configure it for async streaming replication from your master. The config is all generated in your project though, so if you want to change to streaming replication, for instance, just modify the generated file and you're good to go.
Excellent episode. I'm looking forward a "part 2" where you would explain how to set up your own templates!
Thanks!
Is there a reason rubber uses haproxy and not the Amazon Load Balancer? Are there any benefits from using haproxy and is it possible to use the Amazon Load Balancer with rubber?
Very nice episode! But why does rubber upload code to all instance? I would expect it to upload the files only for the instance with the app role.
Awesome episode Ryan! You rocks! ... And awesome gem. Congrats!
this was a great episode. I'm going to give it a try. Two areas that i would be interested in knowing if rubber supports are integrating with ELB and AutoScaling. Any insights from smarter people on this?
thanks
Hey, thanks for the episode. After running the command below:
cap rubber:create_staging
I get the following error:
connection failed for: production.foo.com (Net::SSH::AuthenticationFailed: root)
Assuming that it has something to do with the fact that Ubuntu would not allow a root user to ssh by default I changed my config/deploy.rb file to use ubuntu as user. However, after that I get a similar error:
connection failed for: production.foo.com (Net::SSH::AuthenticationFailed: ubuntu)
Does someone have an idea about why this could be happening. I think it may be related to the ssh keys used but to me things seem ok with them.
In case someone is interested, the problem was due to Mac OS 10.7.3 in my case. They changed the DNS resolve order at some point and now at first place is not /etc/hosts but your local DNS server or something like that. So, production.foo.com is resolved as pointing to a real host using this domain name. I changed foo.com to something non-existent in several rubber config files to solve this problem. Also edited /etc/hosts to have the new domain name I am using.
Hi, could you write down more about how to
I changed foo.com to something non-existent in several rubber config files to solve this problem. Also edited /etc/hosts to have the new domain name I am using.
I am totally new to this stuff. thxHey great video really appreciate it - trying to figure out how to get past these two errors, wondering if you could point me in the right direction:
Rubber[INFO]: Transformation executing post config command: function error_exit { exit 99; }; trap error_exit ERR
config : 'option forwardfor' ignored for proxy 'passenger_proxy_ssl' as it requires HTTP mode.
Here is my deploy.rb
http://pastebin.com/6CdCP7DY
and here is my rubber.yml file
http://pastebin.com/7tUcrMqF
Let me know if you need any additional info...thanks!
I've been getting this error when trying to run the cap rubber:create_staging command. It runs for 20 minutes or so successfully, but breaks when it gets here:
executing "cd /mnt/EvrlistSite-production/releases/20120706050602 && bundle exec rake RAILS_ENV=production db:migrate"
servers: ["production.evrlist.com"]
[production.evrlist.com] executing command
** [out :: production.evrlist.com] rake aborted!
** [out :: production.evrlist.com]
** [out :: production.evrlist.com] FATAL: role "EvrlistSite" does not exist
** [out :: production.evrlist.com]
** [out :: production.evrlist.com] Tasks: TOP = > db:migrate
** [out :: production.evrlist.com]
Ryan, thanks for another excellent railscast!
Hi everyone.. I have to say, setting it up initially wasn't very easy. Turns out rubber is not very happy with "complex" database.yml (with conditional environment if's etc..) or with hyphens in the app name which, at least when using mysql templates, confuse rubber.
After having fixed a few annoying issues - and separating the credentials, I now have a weird issue (and a question below):
The problem I hope someone can shed some light on:
cap rubber:create_staging runs without errors. However, it ends with the same output as rubber:bootstrap does. i.e. the last command is:
* executing "sudo -p 'sudo password: ' bash -l /tmp/create_master_db"
and never actually fires up an apache/passenger to run my app.. and thus the link is not accessible.
Also, a bit above, collectd throws an error:
** [out :: production.foo.com] Starting statistics collection and monitoring daemon: collectd
** [out :: production.foo.com] configfile: stat (/etc/collectd/conf.d/*.conf) failed: No such file or directory
Can collectd be the reason why my app doesn't actually start? I'm using rubber 2.0.5 by the way. Or may it be that it requires me to run another command to get things started (even on staging)?
And the other question:
I'm using the complete_passenger_mysql template - which hopefully includes everything - but was tempted to use complete_passenger_nginx_mysql - any benefit in doing this instead??
Typo in ASCII-Cast
gsg-keypair.gem should be gsg-keypair.pem
I used this tutorial for the free tier, and didn't even finish it due to errors, but I was still charged $40 at the end of the month for barely a couple days of using this service. I terminated my instances within a few days of using rubber. Even the default small instances are only $0.08/hr.
Please can someone tell me what I am doing wrong here?
Thanks!
diglett,
Did you create your instances using the AMI-Type : m1.small or any other option other than t1.micro?
The t1.micro is the free ami-type
Anybody knows what this error is about?
happens on
cap rubber:create_staging
is this supposed to be filled in
fog:
credentials:
provider: rackspace
rackspace_api_key: 'XXX'
rackspace_username: 'YYY'
image_type: 123
image_id: 123
switched the secret access key and access key.... works
Anybody know why this happen ?
First check if your private key is in ~/.ec2 directory.
After, try to remove the .pem extension from your private key file.
Hi all,
Running cap rubber:create_staging
I get this error:
Missing rule, creating: {"source_group_name"=>"blog_production_default", "source_group_account"=>"1072835180", "protocol"=>"tcp", "from_port"=>"1", "to_port"=>"65535"}
[DEPRECATION] 'account:group' argument is deprecated. Use {account => group} or just group instead
/home/user/.rvm/gems/ruby-1.9.3-p194/gems/excon-0.16.4/lib/excon/connection.rb:290:in `request_kernel': The security group 'blog_production_default' does not exist (Fog::Compute::AWS::NotFound)
Does anybody know whats going on?
Thanks!.
@Sebastian its probably too late for you, but for anyone else with this problem, It happened to me and the reason was I was using my user name for the account field as opposed to my AWS account number. I'm assuming that if the account number is wrong, a similar error will ensue.
Minor not that may help folks if you aren't familiar with yml files (I am not) :
if you want to put your AWS account, access key, and secret access key in enviornment variables, you must use the <%= %> brackets to access them. For example :
access_key: <%= ENV["AWS_ACCESS_KEY"] %>
This is unlike other rails configuration files. I'm not quite sure why since yml files look ruby-ish.
Hello,
I followed all the steps, and when I visit the ip address ( or domain name set in hosts ) I get apache server's default page "It works". I did not get rails app.
I have an EC2 tiny instance with ubuntu 12.04 in it.
Please help.
HI Karthik,
I have the same issue, did you figure out why its happening ? when i put "production.foo.com" in url...it shows the same message as yours. Please help !
One thing that caused me some consternation: a misnamed keyfile.
When you create the keypair at Amazon, the name listed on amazon must match the filename locally.
Also, Ryan removes the .pem extension, from gsg-keypair...and Rubber does not tack .pem onto what you define in rubbery.yml.
So in short, make sure the key files names match everywhere.
I'm trying to resolve this issue now, are you saying not to remove .pem like Ryan does?
I have few questions to rubber template:
when i run with template "complete_passenger_nginx", it asked me which database with error. Just for information, i use RDS Amazon for MySQL service. so I choose "complete_passenger_nginx_mysql".
At here, rubber is generated successfully. My ec2 is installed on ubuntu 64bit and rbenv (not rvm). But I confuse, if autoscaling will use rbenv to control my passenger. Because i check in config/rubber/passenger.yml, it uses rvm not rbenv.
How i can make my rubber uses rbenv to control my ruby, rails and passenger, not rvm and native ruby? will it be problem when scaling is run, if i left rvm as default configuration for my passenger?
Many Thanks,
Yacobus Reinhart
Can anyone please reply why rubber commands do not work in eclipse terminal...
I am getting this -
$ rubber vulcanize complete_passenger_postgresql
ERROR: No such sub-command 'vulcanize'
See: 'rubber --help'
Getting this error - Please help me
** [out :: production.foo.com]
** [out :: production.foo.com] /usr/local/rvm/gems/ruby-1.9.3-p194/gems/mongo-1.3.1/lib/mongo/connection.rb:518:in
connect'
setup'** [out :: production.foo.com] :
** [out :: production.foo.com] Failed to connect to a master node at production.foo.com:27017
** [out :: production.foo.com] (
** [out :: production.foo.com] Mongo::ConnectionFailure
** [out :: production.foo.com] )
** [out :: production.foo.com] from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/mongo-1.3.1/lib/mongo/connection.rb:656:in
** [out :: production.foo.com] from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/mongo-1.3.1/lib/mongo/connection.rb:101:in
initialize'
new'** [out :: production.foo.com] from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/mongo-1.3.1/lib/mongo/connection.rb:152:in
** [out :: production.foo.com] from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/mongo-1.3.1/lib/mongo/connection.rb:152:in
from_uri'
master'** [out :: production.foo.com] from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/mongoid-2.4.5/lib/mongoid/config/database.rb:89:in
** [out :: production.foo.com] from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/mongoid-2.4.5/lib/mongoid/config/database.rb:22:in
configure'
configure_databases'** [out :: production.foo.com] from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/mongoid-2.4.5/lib/mongoid/config.rb:273:in
** [out :: production.foo.com] from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/mongoid-2.4.5/lib/mongoid/config.rb:94:in
from_hash'
block in load!'** [out :: production.foo.com] from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/mongoid-2.4.5/lib/mongoid/config.rb:109:in
** [out :: production.foo.com] from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/mongoid-2.4.5/lib/mongoid/config.rb:108:in
tap'
load!'** [out :: production.foo.com] from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/mongoid-2.4.5/lib/mongoid/config.rb:108:in
** [out :: production.foo.com] from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/mongoid-2.4.5/lib/mongoid.rb:147:in
load!'
block in class:Railtie'** [out :: production.foo.com] from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/mongoid-2.4.5/lib/mongoid/railtie.rb:84:in
** [out :: production.foo.com] from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.1.3/lib/rails/initializable.rb:30:in
instance_exec'
run'** [out :: production.foo.com] from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.1.3/lib/rails/initializable.rb:30:in
** [out :: production.foo.com] from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.1.3/lib/rails/initializable.rb:55:in
block in run_initializers'
each'** [out :: production.foo.com] from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.1.3/lib/rails/initializable.rb:54:in
** [out :: production.foo.com] from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.1.3/lib/rails/initializable.rb:54:in
run_initializers'
initialize!'** [out :: production.foo.com] from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.1.3/lib/rails/application.rb:96:in
** [out :: production.foo.com] from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.1.3/lib/rails/railtie/configurable.rb:30:in
method_missing'
'** [out :: production.foo.com] from /usr/local/graylog2-web-interface-0.9.6p1/config/environment.rb:6:in
** [out :: production.foo.com] from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in
require'
block in require'** [out :: production.foo.com] from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in
** [out :: production.foo.com] from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in
block in load_dependency'
new_constants_in'** [out :: production.foo.com] from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:640:in
** [out :: production.foo.com] from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in
load_dependency'
require'** [out :: production.foo.com] from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in
** [out :: production.foo.com] from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.1.3/lib/rails/application.rb:83:in
require_environment!'
'** [out :: production.foo.com] from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.1.3/lib/rails/commands/runner.rb:40:in
** [out :: production.foo.com] from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.1.3/lib/rails/commands.rb:63:in
require'
'** [out :: production.foo.com] from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.1.3/lib/rails/commands.rb:63:in
** [out :: production.foo.com] from ./script/rails:6:in
require'
'** [out :: production.foo.com] from ./script/rails:6:in
command finished in 172775ms
failed: "/bin/bash -l -c 'sudo -p '\''sudo password: '\'' bash -l /tmp/bootstrap_graylog_web'" on production.foo.com
Did you get this fixed? I'm having the same issue!
I'm having the same issue. Does someone knows the answer?
I'm betting you're trying to deploy to an instance with 8GB of storage (like a T1.micro)? Try adding the following to config/rubber/role/mongodb/mongodb.conf:
Hi,
I've the same problem.
I'm trying to deploy to an instance with 8GB of storage (T1.micro).
Adding 'smallfiles = true' to config/rubber/role/mongodb/mongodb.conf did not work for me.
Did someone solve this problem?
Same problem here. Submitted it as an issue on the gem - https://github.com/rubber/rubber/issues/319.
@carlosmendes @skwasha @Heber Massami Nunomura @rich833 @kmamit Did you get it to work and how?
Edit
If I do cap deploy afterwards, then it deploys and works fine, but this issue should probably be fixed
cap rubber:bootstrap
solved the problem.
@carlosmendes Did you do that before or after you did cap rubber:create_instance?
after (sorry for the late reply)
Same problem here. If I run "cap deploy" after a failed "cap rubber:create_staging" deployment I'll get the following error:
** [out :: production.blog.com] rake aborted!
** [out :: production.blog.com] could not connect to server: Connection refused
** [out :: production.blog.com] Is the server running on host "production.blog.com" (10.210.xxx.xx) and accepting
** [out :: production.blog.com] TCP/IP connections on port 5432?
Any other ideas how to fix this Mongo::ConnectionFailure? The last time I deployed (4-5 months ago everything worked like a charm). Updated to latest rubber version.
When I install the Rubber gem, I only have access to the config command. I.e. I can't call Vulcanize. See my post on Stack Overflow for a print screen: http://stackoverflow.com/questions/14522051/rails-rubber-gem-no-such-sub-command-vulcanize/14536914#14536914
Does anybody know how to fix this? It sounds like it could fix @kmamit's problem above too.
Thanks Ryan for great post. This railscast give me the most valuable 9$ per month :)
In my last deployment I received this:
[Thu Mar 14 03:34:18 2013] [warn] default VirtualHost overlap on port 8080, the first has precedence
** [out :: staging.absolutecommerce.com]
** [out :: staging.absolutecommerce.com] [Thu Mar 14 03:34:18 2013] [warn] default VirtualHost overlap on port 7001, the first has precedence
** [out :: staging.absolutecommerce.com]
** [out :: staging.absolutecommerce.com] [Thu Mar 14 03:34:18 2013] [warn] default VirtualHost overlap on port 7000, the first has precedence
** [out :: staging.absolutecommerce.com]
** [out :: staging.absolutecommerce.com] [Thu Mar 14 03:34:18 2013] [warn] NameVirtualHost *:8443 has no VirtualHosts
** [out :: staging.absolutecommerce.com]
** out :: staging.absolutecommerce.comAddress already in use: make_sock: could not bind to address 0.0.0.0:7000
** [out :: staging.absolutecommerce.com]
** [out :: staging.absolutecommerce.com] no listening sockets available, shutting down
** [out :: staging.absolutecommerce.com]
** [out :: staging.absolutecommerce.com] Unable to open logs
** [out :: staging.absolutecommerce.com]
** [out :: staging.absolutecommerce.com] Action 'start' failed.
** [out :: staging.absolutecommerce.com]
** [out :: staging.absolutecommerce.com] The Apache error log may have more information.
[
** [out :: staging.absolutecommerce.com]
** [out :: staging.absolutecommerce.com] fail
** [out :: staging.absolutecommerce.com]
** [out :: staging.absolutecommerce.com] ]
Can anybody tell me how to solve the problem?
I get the following error after running "cap rubber:create_staging
/Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/excon-0.20.1/lib/excon/middlewares/expects.rb:10:in
response_call': Unable to find group 'blog_production_default' (Fog::Compute::AWS::NotFound)
response'from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/excon-0.20.1/lib/excon/connection.rb:332:in
from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/excon-0.20.1/lib/excon/connection.rb:226:in
request'
error_call'from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/excon-0.20.1/lib/excon/middlewares/idempotent.rb:12:in
from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/excon-0.20.1/lib/excon/middlewares/base.rb:10:in
error_call'
rescue in request'from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/excon-0.20.1/lib/excon/connection.rb:239:in
from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/excon-0.20.1/lib/excon/connection.rb:200:in
request'
error_call'from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/excon-0.20.1/lib/excon/middlewares/idempotent.rb:12:in
from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/excon-0.20.1/lib/excon/middlewares/base.rb:10:in
error_call'
rescue in request'from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/excon-0.20.1/lib/excon/connection.rb:239:in
from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/excon-0.20.1/lib/excon/connection.rb:200:in
request'
error_call'from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/excon-0.20.1/lib/excon/middlewares/idempotent.rb:12:in
from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/excon-0.20.1/lib/excon/middlewares/base.rb:10:in
error_call'
rescue in request'from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/excon-0.20.1/lib/excon/connection.rb:239:in
from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/excon-0.20.1/lib/excon/connection.rb:200:in
request'
request'from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/fog-1.10.0/lib/fog/core/connection.rb:21:in
from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/fog-1.10.0/lib/fog/aws/compute.rb:384:in
_request'
request'from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/fog-1.10.0/lib/fog/aws/compute.rb:379:in
from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/fog-1.10.0/lib/fog/aws/requests/compute/authorize_security_group_ingress.rb:54:in
authorize_security_group_ingress'
authorize_port_range'from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/fog-1.10.0/lib/fog/aws/models/compute/security_group.rb:104:in
from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/rubber-2.2.4/lib/rubber/cloud/fog.rb:182:in
add_security_group_rule'
method_missing'from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/rubber-2.2.4/lib/rubber/thread_safe_proxy.rb:13:in
from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/rubber-2.2.4/lib/rubber/recipes/rubber/security_groups.rb:218:in
block (2 levels) in sync_security_groups'
each'from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/rubber-2.2.4/lib/rubber/recipes/rubber/security_groups.rb:214:in
from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/rubber-2.2.4/lib/rubber/recipes/rubber/security_groups.rb:214:in
block in sync_security_groups'
each'from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/rubber-2.2.4/lib/rubber/recipes/rubber/security_groups.rb:208:in
from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/rubber-2.2.4/lib/rubber/recipes/rubber/security_groups.rb:208:in
sync_security_groups'
setup_security_groups'from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/rubber-2.2.4/lib/rubber/recipes/rubber/security_groups.rb:51:in
from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/rubber-2.2.4/lib/rubber/recipes/rubber/instances.rb:268:in
block in create_instance'
synchronize'from <internal:prelude>:10:in
from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/rubber-2.2.4/lib/rubber/recipes/rubber/instances.rb:267:in
create_instance'
block (2 levels) in create_instances'from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/rubber-2.2.4/lib/rubber/recipes/rubber/instances.rb:230:in
A little warning.
Have been playing around with rubber and using this great tutorial as a guide. Create 3 instances and forgot about them for some weeks... BANG, amazon send me a whopping bill of $168.
Play around with the t1.micro instance and not the instances that are being played around with in the rails cast!
Hi Ryan,
I was hoping you could weigh in here, I'd like to create a rubber capistrano recipe to deploy my rails app using nginx and phusion passenger enterprise edition. The main problem I have is changing the rubber tasks to install the passenger gem from a local file instead of from the open-source repo. If you could please provide some guidance I would be very appreciative.
Help please,
followed the tutorial but when I use cap rubber:create_staging I get the following error:
Creating instance ami-b6089bdf/c1.medium/likeme_production_default,likeme_production_web,likeme_production_web_tools,likeme_pr
oduction_production,likeme_production_apache,likeme_production_app,likeme_production_passenger,likeme_production_collectd,likeme_p
roduction_common,likeme_production_monit,likeme_production_db,likeme_production_postgresql,likeme_production_postgresql_master,lik
eme_production_elasticsearch,likeme_production_examples,likeme_production_graphite_server,likeme_production_graphite_web,likeme_pr
oduction_graylog_elasticsearch,likeme_production_graylog_mongodb,likeme_production_mongodb,likeme_production_graylog_server,likeme
_production_graylog_web,likeme_production_haproxy/us-east-1
/home/alon/.rvm/gems/ruby-1.9.3-p429/gems/excon-0.22.1/lib/excon/middlewares/expects.rb:10:in `response_call': Expected(200) <=> A
ctual(400 Bad Request) (Excon::Errors::BadRequest)
alonzorz... have you resolved this? I am running into the same problem.
even I am seeing the same problem.
Any fix for this?
does any one had that problem after using the rubber:create ?
ruby-1.9.3-p429/gems/excon-0.23.0/lib/excon/middlewares/expects.rb:10:in `response_call': SecurityGroupLimitExceeded => You have exceeded the number of VPC security groups allowed per instance. (Fog::Compute::AWS::Error)
Thanks.
I also got same error. You found any solution ??
+1
Any solution?
Try uncommenting and putting in values for :web_tools_user and :web_tools_password in rubber.yml. It solved the problem for me.
This is a limit enforced by Amazon that does not exist in the EC2-Classic setup.
http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Appendix_Limits.html
You will have to contact them to increase this restriction.
in rubber.yml:
http://www.flaskofespresso.com/2013/08/rails-rubber-aws-ec2-deployment-issues-with-groups-and-rules/
Hi
I followed this tutorial, but I found error.
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/excon-0.23.0/lib/excon/midd
response_call': The key pair 'ginfy' does not exist (Flewares/expects.rb:10:in
og::Compute::AWS::NotFound)
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/excon-0.23.0/l
ib/excon/connection.rb:353:in
response'
request'from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/excon-0.23.0/l
ib/excon/connection.rb:247:in
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/fog-1.12.1/lib
/fog/core/connection.rb:25:in
request'
_request'from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/fog-1.12.1/lib
/fog/aws/compute.rb:385:in
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/fog-1.12.1/lib
/fog/aws/compute.rb:380:in
request'
run_instances'from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/fog-1.12.1/lib
/fog/aws/requests/compute/run_instances.rb:119:in
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/fog-1.12.1/lib
/fog/aws/models/compute/server.rb:179:in
save'
create'from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/fog-1.12.1/lib
/fog/core/collection.rb:52:in
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rubber-2.5.2/l
ib/rubber/cloud/fog.rb:30:in
create_instance'
method_missing'from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rubber-2.5.2/l
ib/rubber/thread_safe_proxy.rb:13:in
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rubber-2.5.2/l
ib/rubber/recipes/rubber/instances.rb:311:in
create_instance'
block (2 levels) in create_instancfrom c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rubber-2.5.2/l
ib/rubber/recipes/rubber/instances.rb:230:in
es'
Why it is not found my key-pair pem file? Please help.
I solved this problem, but now I got another problem
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/excon-0.23.0/lib/excon/midd
response_call': MissingParameter => Source group ID milewares/expects.rb:10:in
ssing. (Fog::Compute::AWS::Error)
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/excon-0.23.0/l
ib/excon/connection.rb:353:in
response'
request'from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/excon-0.23.0/l
ib/excon/connection.rb:247:in
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/excon-0.23.0/l
ib/excon/middlewares/idempotent.rb:12:in
error_call'
error_call'from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/excon-0.23.0/l
ib/excon/middlewares/base.rb:10:in
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/excon-0.23.0/l
ib/excon/connection.rb:260:in
rescue in request'
request'from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/excon-0.23.0/l
ib/excon/connection.rb:220:in
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/excon-0.23.0/l
ib/excon/middlewares/idempotent.rb:12:in
error_call'
error_call'from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/excon-0.23.0/l
ib/excon/middlewares/base.rb:10:in
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/excon-0.23.0/l
ib/excon/connection.rb:260:in
rescue in request'
request'from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/excon-0.23.0/l
ib/excon/connection.rb:220:in
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/excon-0.23.0/l
ib/excon/middlewares/idempotent.rb:12:in
error_call'
error_call'from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/excon-0.23.0/l
ib/excon/middlewares/base.rb:10:in
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/excon-0.23.0/l
ib/excon/connection.rb:260:in
rescue in request'
request'from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/excon-0.23.0/l
ib/excon/connection.rb:220:in
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/fog-1.12.1/lib
/fog/core/connection.rb:25:in
request'
_request'from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/fog-1.12.1/lib
/fog/aws/compute.rb:385:in
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/fog-1.12.1/lib
/fog/aws/compute.rb:380:in
request'
revoke_securitfrom c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/fog-1.12.1/lib
/fog/aws/requests/compute/revoke_security_group_ingress.rb:54:in
y_group_ingress'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/fog-1.12.1/lib
/fog/aws/models/compute/security_group.rb:218:in
revoke_port_range'
remove_security_group_rule'from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rubber-2.5.2/l
ib/rubber/cloud/aws.rb:381:in
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rubber-2.5.2/l
ib/rubber/cloud/aws.rb:454:in
block (2 levels) in sync_security_groups'
each'from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rubber-2.5.2/l
ib/rubber/cloud/aws.rb:437:in
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rubber-2.5.2/l
ib/rubber/cloud/aws.rb:437:in
block in sync_security_groups'
each'from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rubber-2.5.2/l
ib/rubber/cloud/aws.rb:393:in
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rubber-2.5.2/l
ib/rubber/cloud/aws.rb:393:in
sync_security_groups'
setup_security_groups'from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rubber-2.5.2/l
ib/rubber/cloud/aws.rb:254:in
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rubber-2.5.2/l
ib/rubber/cloud/aws.rb:72:in
before_create_instance'
method_missing'from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rubber-2.5.2/l
ib/rubber/thread_safe_proxy.rb:13:in
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rubber-2.5.2/l
ib/rubber/recipes/rubber/instances.rb:267:in
block in create_instance'
mon_sfrom c:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/monitor.rb:211:in
ynchronize'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rubber-2.5.2/l
ib/rubber/recipes/rubber/instances.rb:266:in
create_instance'
block (2 levels) in create_instancfrom c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rubber-2.5.2/l
ib/rubber/recipes/rubber/instances.rb:230:in
es'
Please check my issues at Stackoverflow
http://stackoverflow.com/questions/17168782/rubber-and-amazon-ec2-ror-hosting-issue
I was having this problem and this is the answer I found.
http://stackoverflow.com/questions/11762401/rubber-2-fog-and-keypair-error
I just deploy this application to EC2 and got no errors but when I go and try to see the page using production.foo.com or the actual *.amazonaws.com URL it shows me an error message like this:
"The page you were looking for doesn't exist.
You may have mistyped the address or the page may have moved."
Any ideas?
I'm getting this, did you manage to solve it?
I solved this, turns out running create_staging didn't actually deploy the app. I'm not sure why but I had to run a cold deploy to actually get the app live.
If you are having issues getting started with Rubber take a look at this post. I had a few issues getting started and this is how I resolved them.
http://www.flaskofespresso.com/2013/08/rails-rubber-aws-ec2-deployment-issues-with-groups-and-rules/
Don't use dashes (-) in
rubber.yml
file because you will run into an error when you runcap rubber:create_staging
.I had this problem, put an - in my app name and postgres kept erroring. Spent a day trouble shooting postgres by ssh until I noticed the string settings in the yml file.
Annoying the string format isn't in any documentation.
If you're using the nginx-unicorn-postgres template and you can't get this to work:
This is because this template doesn't include a load-balancer. (Unicorn only works on a single machine). In the railscast, haproxy serves as the load balancer and runs in the web instance and delegates to the app instances. haproxy though is not a part of the nginx-unicorn-postgres template. As I understand it, you can either
a) add haproxy to your rubber setup and include it in the web role or
b) if you're using AWS, you can use amazon's ELB (Elastic Load Balancer)
More info on this stuff at the following links.
https://github.com/rubber/rubber/issues/325
https://groups.google.com/forum/?fromgroups=#!topic/rubber-ec2/BxxlrZ1lEug
Also see Rob Bastian's comment above
If your getting:
"FATAL: role "postgres" does not exist"
Then it's likely you did what I did and put a - in your app name. Remove it.
NOTE:
This tutorial example creates a c1.medium instance type on the EC2 and that'll cost $0.145 per Hour.
The
image_type
for the instance is defined at around line 89 of rubber.yml. To avoid accidental large bill from Amazon, you should choose another instance type from: EC2 pricing+1 , this happened to me..good point !
Great episode!
We have followed the tutorial and succeeded setting up multiple instances with haproxy as load balancer. We used "complete_passenger_nginx_postgres" template of Rubber.
However, uploading file (with size larger than 1MB) from browser to the server cannot reach the rails server of the app instances. It seems to be blocked from haproxy or some prior layers.
We checked nginx's client_max_body_size and it's already set to 10M.
Do you guys have any idea on this issue and how to fix it? Thank you in advance!
Oops, we are so sorry but we have solved it... it happened due to a wrong configuration on the server...
Totally agree with Robert, it is one of the best episode!!
I was following the tutorial, attempting to test out deployment with Rubber. Managed to survive from the Duplicated rules error, creating instance error, etc but I was finally stopped by the infinite connection loop:
** Instance running, fetching hostname/ip data
Trying to enable root login
* 2014-01-16 15:36:41 executing
rubber:_ensure_key_file_present'
rubber:allow_root_ssh'* 2014-01-16 15:36:41 executing
* executing "sudo -p 'sudo password: ' bash -l -c 'mkdir -p /root/.ssh && cp /home/ubuntu/.ssh/authorized_keys /root/.ssh/'"
servers: ["---.---.---.---"]
** Can't connect as user ubuntu to ---.---.---.---, assuming root allowed
* 2014-01-16 15:36:44 executing
rubber:_direct_connection_---.---.---.---_673'
rubber:_direct_connection---.---.---.---673'* executing "echo"
servers: ["---.---.---.---"]
** Failed to connect to ---.---.---.---, retrying
* 2014-01-16 15:36:48 executing
* executing "echo"
servers: ["---.---.---.---"]
** Failed to connect to ---.---.---.---, retrying
* 2014-01-16 15:36:53 executing `rubber:_direct_connection---.---.---.---_673'
* executing "echo"
servers: ["---.---.---.---"]
The IP is masked...
I have tried a lot of different things:
Manually connect to new instance with ssh and the key
Double check the rubber.yml to see if the key path is correct
Run the cap command in -v
Check if the instance I defined is the same as the default ami type
They all seems Correct so I think there must be something with the command used for rubber to connect and run the "sudo -p 'sudo password: ' bash -l -c 'mkdir -p /root/.ssh && cp /home/ubuntu/.ssh/authorized_keys /root/.ssh/'". However there's no where I can see what Rubber was talking to my instance. I tried to get into the source code but it lead me to no where too.
I have done quite a number of googling and it seems like it is quite a common error but no real solution to this. Can anyone suggest what's likely to be the problem? Thank you.
Solved... It was just a stupid typo.... Sorry guys..
@quindici can you please indicate what the error was, i am getting the same error. Thanks
would this work with sqlite?
After a lot of trouble shooting, I am stuck in this error, any ideas how to fix it?
** [out :: production.foo.com] Version '1:4.0.48-1~precise1' for 'libapache2-mod-passenger' was not found
** [out :: production.foo.com]
command finished in 4405ms
failed: "/bin/bash -l -c 'sudo -p '\''sudo password: '\'' bash -l /tmp/install_packages postfix build-essential git-core libxslt-dev ntp postgresql-client libpq-dev subversion curl autoconf bison ruby zlib1g-dev libssl-dev libreadline6-dev libxml2-dev libyaml-dev apache2 libapache2-mod-proxy-html libcurl4-openssl-dev libapache2-mod-xsendfile apache2-mpm-prefork apache2-prefork-dev libapache2-mod-passenger=1:4.0.48-1~
lsb_release -sc
1 collectd libperl-dev monit postgresql-9.1 openjdk-7-jdk unzip python-django python-django-tagging python-cairo python-memcache memcached uwsgi uwsgi-plugin-python uwsgi-core sqlite3 bzr zip mongodb-10gen haproxy ec2-ami-tools'" on production.foo.comI tried running gem install passenger but didnt fix it. Help please!
Update rubber-passenger.yml. Set:
passenger_version: '1:4.0.53-1~precise1'
when I go to http://production.foo.com/ I get "Apache2 Ubuntu Default Page" does anyone know what happened?
Solved...Thanks
Wow, perfect! Thank you
Solved...Thanks Very...:D