Para esto, los ingredientes son:
- Vagrant
- Docker desde http://docs.docker.io/en/latest/installation/vagrant/
Crear una imagen base (notar el cambio en el prompt.
vagrant@precise64:~$ docker run -i -t base /bin/bash| God.watch do |w| | |
| w.name = "mysql" | |
| w.interval = 30.seconds | |
| w.start = "/etc/init.d/mysql start" | |
| w.stop = "/etc/init.d/mysql stop" | |
| w.restart = "/etc/init.d/mysql restart" | |
| w.start_grace = 20.seconds | |
| w.restart_grace = 20.seconds | |
| w.pid_file = "/var/run/mysqld/mysqld.pid" | |
| w.behavior(:clean_pid_file) |
| # HAProxy | |
| description "HAProxy" | |
| start on runlevel [2345] | |
| stop on runlevel [016] | |
| respawn | |
| respawn limit 2 5 |
| /* select contact .. from TALBE where user="user" and CONDITION into outfile 'path';*/ | |
| select concat('KILL ',id,';') from information_schema.processlist where user='root' and Info like "%fail%" outfile '/tmp/kill.txt'; | |
| source /tmp/kill.txt; |
| frontend front-in | |
| bind 0.0.0.0:80 | |
| acl custom_uri path_beg /something | |
| use_backend super_server if custom_uri | |
| default_backend all_servers | |
| backend all_servers | |
| balance roundrobin | |
| option httpclose | |
| option forwardfor |
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'net/ssh' | |
| Net::SSH.start('server.fqdn', 'foo') do |ssh| | |
| output = ssh.exec("uname -a ; whoami") | |
| puts output | |
| end |
Para esto, los ingredientes son:
Crear una imagen base (notar el cambio en el prompt.
vagrant@precise64:~$ docker run -i -t base /bin/bash| #!/bin/sh | |
| # Require: | |
| # * VirtualBox already installed | |
| # * Internet connection :) | |
| # | |
| # This script will: | |
| # * Download the latest live ISO image of SmartOS | |
| # * Create a VirtualBox VM, or update an existing VM with the latest ISO | |
| # * Configure the VM with a zones disk, and boot it! | |
| # |
| #! /bin/bash | |
| FILE="chef-server_11.0.8-1.ubuntu.12.04_amd64.deb" | |
| wget https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/$FILE | |
| dpkg -i $FILE ; sudo chef-server-ctl reconfigure |
| #!/usr/sbin/dtrace -q | |
| pid$target::*mysql_parse*:entry | |
| { | |
| printf("Query: %s\n", copyinstr(arg1)); | |
| } |