Vous êtes sur la page 1sur 3

Gastn Ramos

"La mayora de las gaviotas no se molesta en aprender sino las normas de vuelo ms elementales: como ir y volver entre playa y comida. Para la mayora de
las gaviotas, no es volar lo que importa, sino comer. Para esta gaviota, sin embargo, no era comer lo que le importaba, sino volar. Ms que nada en el mundo,
Juan Salvador Gaviota amaba volar".
Installing Warden on debian Wheezy
by Gastn Ramos
What is warden?
The projects primary goal is to provide a simple API for managing isolated environments. These isolated environments or containers
can be limited in terms of CPU usage, memory usage, disk usage, and network access. As of writing, the only supported OS is Linux.
read more here: https://github.com/cloudfoundry/warden/tree/master/warden (https://github.com/cloudfoundry/warden/tree/master
/warden)
Warden is a key component in the Cloud Foundry (http://docs.cloudfoundry.com/) ecosystem. When you push a new app to Cloud Foundry
a new container will be created.
So, lets go to the point, the idea is to install warden in a debian wheezy system, I added debian support to warden in my fork in the Altoros
repo: https://github.com/Altoros/warden (https://github.com/Altoros/warden)
In order make a fresh installation we are going to use vagrant with virtualbox provider, lets start downloading the vagrant box from
http://www.vagrantbox.es/ (http://www.vagrantbox.es/).
axe -h 10 h11p.//dowhoads.shadowaJe.oJg/wheezy64.box
Then add the new box to vagrant:
vagJah1 box add deb1ah-wheezy64 wheezy64.box
Then list all the available boxes to see if it was added ok:
vagJah1 box 1s1
and you should see something like that:
deb1ah-wheezy64 {v1J1uabox)
pJec1se64 {v1J1uabox)
Then lets create a new folder and create our vagrant VM
using the box that we just already added:
mkd1J 1es11hg-waJdeh-oh-deb1ah
cd 1es11hg-waJdeh-oh-deb1ah
vagJah1 1h11 deb1ah-wheezy64
Now we are ready to start installing warden in the VM:
vagJah1 ssh
sudo ap1-ge1 1hs1a -y bu1d-esseh11a deboo1s1Jap quo1a
Edit fstab and add this line:
sudo v1 /e1c/1s1ab
cgJoup /sys/1s/cgJoup cgJoup de1au1s 0 0
Now clone the warden repo and checkout the add-debian-rootfs
branch
About these ads (http://en.wordpress.com/about-these-ads/)
nstaIIIng Warden on debIan Wheezy | Gastn Iamos http.//gastonramos.wordpress.com/2013/10/16/InstaIIIn...
1 oI 3 01/17/2014 02.30 IM
g11_g11hub.com.A1oJos/waJdeh.g11
cd waJdeh
g11 checkou1 add-deb1ah-Joo11s
add warden as shared folder in Vagrant file
edit Vagrant file and add this line:
coh11g.vm.syhced_1odeJ "waJdeh", "/waJdeh"
then login into the vm with ssh and install all required gems:
vagJah1 ssh
cd /waJdeh
sudo gem 1hs1a buhdeJ
sudo buhde
edit config/linux.yml and change the container_rootfs_path,
if you dont change it the setup will be lost after you reboot the vm because it is pointed to /tmp by default.
Ive created a new dir in /tmp-warden and pointed the root_fs to it.
After that you can run the setup
sudo buhde exec Jake se1up|coh11g/1hux.ym]
and when it finishes you will be able to start the warden server:
sudo buhde exec Jake waJdeh.s1aJ1
and then run the client to be able to manage containers:
buhde exec b1h/waJdeh
Lets run some basic warden commands:
Create 2 new containers:
buhde exec b1h/waJdeh
waJdeh> cJea1e
hahde . 171hpgc82u
waJdeh> cJea1e
hahde . 171hpgc82v
waJdeh>
List the already created containers:
waJdeh> 1s1
hahdes|0] . 171hpgc82u
hahdes|1] . 171hpgc82v
waJdeh>
You can see the directories of the containers, replace [tmp-warden] with the folder that your filled in the config/linux.yml:
s - /|1mp-waJdeh]/waJdeh/coh1a1heJs/
dJwxJ-xJ-x 9 Joo1 Joo1 4096 Ju 15 13.55 171hpgc82u
dJwxJ-xJ-x 9 Joo1 Joo1 4096 Ju 15 13.58 171hpgc82v
dJwxJ-xJ-x 2 Joo1 Joo1 4096 Ju 15 12.18 1mp
If you take a look to the logs while you create a container, you can figure out that this is the flow more or less:
1. method: set_deferred_success
/home/gJamos/sJc/a1oJos/waJdeh/waJdeh/1b/waJdeh/coh1a1heJ/spawh.Jb
nstaIIIng Warden on debIan Wheezy | Gastn Iamos http.//gastonramos.wordpress.com/2013/10/16/InstaIIIn...
2 oI 3 01/17/2014 02.30 IM
2. Create the container
/home/gJamos/sJc/a1oJos/waJdeh/waJdeh/Joo1/1hux/cJea1e.sh /|1mp-waJdeh]/waJdeh/coh1a1heJs/171hpgc831
3. method:do_create
/home/gJamos/sJc/a1oJos/waJdeh/waJdeh/1b/waJdeh/coh1a1heJ/1hux.Jb
4. Start the container
/|1mp-waJdeh]/coh1a1heJs/171hpgc831/s1aJ1.sh
5. method: write_snapshot
/home/gJamos/sJc/a1oJos/waJdeh/waJdeh/1b/waJdeh/coh1a1heJ/base.Jb
6. method: dispatch
/home/gJamos/sJc/a1oJos/waJdeh/waJdeh/1b/waJdeh/coh1a1heJ/base.Jb
And thats all, if you have any comments feel free to post them here!
PUBLISHED: Wednesday, 16 October , 2013 (2013-10-16T12:45:25-0300)
FILED UNDER: cloudfoundry, ruby
TAGS: cf : cloudfoundry : container : linux : warden
Blog at WordPress.com. The Manifest Theme.
Follow
Follow Gastn Ramos
Powered by WordPress.com
nstaIIIng Warden on debIan Wheezy | Gastn Iamos http.//gastonramos.wordpress.com/2013/10/16/InstaIIIn...
3 oI 3 01/17/2014 02.30 IM

Vous aimerez peut-être aussi