Giter Club home page Giter Club logo

moonshine_multi_server's Introduction

Moonshine Multi Server

A plugin for Moonshine

A plugin for deploying one application to multiple servers

Instructions

  • Install the Moonshine
  • Configure servers for capistrano setting the appropriate role(s). Here is an example config/deploy.rb:
  server 'web.example.com', :web, :primary => true
  server 'app.example.com', :app, :primary => true
  server 'db.example.com', :db, :primary => true
  • Install the Moonshine Multi Server plugin:
Rails 2: script/plugin install https://github.com/railsmachine/moonshine_multi_server.git
Rails 3: script/rails plugin install https://github.com/railsmachine/moonshine_multi_server.git
  • After the plugin is installed, generate some manifests!
Rails 2: script/generate moonshine:multi_server web app db
Rails 3: script/rails generate moonshine:multi_server web app db
  • create a manifest for each role:
    • app/manifests/application_manifest_.rb
    • app/manifests/database_manifest_.rb
    • app/manifests/web_manifest_.rb
  • Add the stacks you need to each manifest. Here is an example app/manifests/application_manifest.rb:
require "#{File.dirname(__FILE__)}/../../vendor/plugins/moonshine/lib/moonshine.rb"
class ApplicationManifest < Moonshine::Manifest::Rails
  include Moonshine::MultiServer
  recipe :standalone_application_stack
end
  • Add one bit to your capistrano config/deploy.rb
namespace :moonshine do
  task :apply do
    moonshine.multi_server_apply
  end  
end

TODO

  • Document MySQL allowed hosts
  • Document *_servers helpers
  • More thorough examples
  • Examples with having more than app,web,db roles
  • Generator?!
  • script/generate moonshine_multi_server app web db util
  • build capistrano servers from *_servers datas

Unless otherwise specified, all content copyright © 2014, Rails Machine, LLC

moonshine_multi_server's People

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

bryantraywick

moonshine_multi_server's Issues

deploy:setup broken on Ubuntu 10.04, works on 12.04

After extensive testing, I've come to the conclusion that Moonshine Multi Server fails on initial deploy:setup. Ruby and Ruby gems install, but then when the manifest is read by Shadow Puppet, Ruby throws the following error:

executing "sudo -p 'sudo password: ' shadow_puppet /tmp/moonshine_setup_manifest.rb"
** [out :: ] Uncaught exception: TypeError: superclass mismatch for class DateTime
** [out :: ] /usr/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
** [out :: ] /usr/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
** [out :: ] /usr/lib/ruby/1.9.1/date.rb:3:in `<top (required)>'
** [out :: ] /usr/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
** [out :: ] /usr/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
** [out :: ] /usr/lib/ruby/1.9.1/time.rb:43:in `<top (required)>'
** [out :: ] /usr/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
** [out :: ] /usr/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
** [out :: ] /usr/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/active_support/xml_mini.rb:1:in `<top (required)>'
** [out :: ] /usr/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
** [out :: ] /usr/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
** [out :: ] /usr/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/active_support/core_ext/array/conversions.rb:1:in `<top (required)>'
** [out :: ] /usr/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
** [out :: ] /usr/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
** [out :: ] /usr/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/active_support/core_ext/object/conversions.rb:3:in `<top (required)>'
** [out :: ] /usr/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
** [out :: ] /usr/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
** [out :: ] /usr/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/active_support/core_ext/object.rb:8:in `<top (required)>'
** [out :: ] /usr/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
** [out :: ] /usr/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
** [out :: ] /usr/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/active_support/core_ext.rb:3:in `block in <top (required)>'
** [out :: ] /usr/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/active_support/core_ext.rb:1:in `each'
** [out :: ] /usr/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/active_support/core_ext.rb:1:in `<top (required)>'
** [out :: ] /usr/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
** [out :: ] /usr/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
** [out :: ] /usr/lib/ruby/gems/1.9.1/gems/shadow_puppet-0.6.3/lib/shadow_puppet/core_ext.rb:6:in `<top (required)>'
** [out :: ] /usr/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
** [out :: ] /usr/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
** [out :: ] /usr/lib/ruby/gems/1.9.1/gems/shadow_puppet-0.6.3/bin/shadow_puppet:118:in `<top (required)>'
** [out :: ] /usr/bin/shadow_puppet:19:in `load'
** [out :: ] /usr/bin/shadow_puppet:19:in `<main>'
   command finished in 653ms

I've done extensive testing over the past 24 hours using Ubuntu 10.04 and 12.04, two RackSpace accounts and 2 completely different Rails apps. Here's what I did and what happened:

  • Deployed new Moonshine Multi config on mature Rails 3.1.x app to Ubuntu 10.04 and got failure
  • Tweaked, messed about, simplified, repeated several times with fresh Ubuntu image each time
  • Went to a completely different Rails 3.1.x app that successfully deploys currently to Ubuntu 12.04 and had successfully deployed to Ubuntu 10.04 sometime around July or possibly June. It failed with the same error
  • Created Ubuntu 10.04 image on a different account and tried the second app there. Same failure
  • Created an Ubuntu 12.04 image with same settings. Second app succeeded with no problem.
  • Went back to the first app and pointed it at a fresh 12.04 image and it succeeded.

My conclusion is that something has broken WRT Ubuntu 10.04 since Summer 2013 WRT deploy:setup.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.