Hola a todos,

Como sabéis llevo tiempo trabajando en el mundo de las TI y escribiendo algunos artículos sobre tecnología. Echemos un vistazo atrás y busquemos un articulo aleatorio sobre el asunto, por ejemplo, este mismo [intlink id=»2817″ type=»post»]GlusterFS[/intlink]. En ese articulo como podeis apreciar se hace uso de 5 máquinas, en mi caso, en esa época las instale y configure manualmente para poder escribirlo ejecutando los comandos directamente en una infraestructura real.

Bien, desde hace un tiempo, el aprovisionamiento de la infraestructura lo podemos obtener «automagicamente» con diversas herramientas, pero hoy quiero hablar de una en concreto, Vagrant.

Lo que voy a hacer en este articulo es lo siguiente

  • Voy a comentar un poco sobre Vagrant, aunque si enrollarme mucho, puesto que tenéis multitud de documentación para poder ahondar en el asunto. Lo importante no es conocer con todo nivel de detalle la herramienta, sino conocer el concepto para después desarrollarlo con paciencia
  • Voy a definir un proyecto Vagrant para poder crear toda la infraestrcutra del articulo origen con un solo comando

Bien comenzamos

¿Que es Vagrant?

Es una tecnología que nos permite crear entornos portables, ligeros y lo mas importante, al menos para mi, reproducibles. Dicho de otra forma, definamos la infraestructura del proyecto o en mi caso articulo en el que estoy trabajando, escribamosla en un fichero Vagrant, y ejecutemos el comando para que el entorno se levante adecuadamente, tan sencillo como eso. Ahora bien, el asunto es escribir adecuadamente el fichero de descripción de entorno o Vagrantfile.

¿Que necesitamos a nivel Vagrant para poder comenzar?

  • Necesitamos descargar el software de Vagrant e instalarlo, nada mas. No voy a entrar en mas detalles porque es muy sencillo, solo bajar e instalar
  • Un detalle importante es que Vagrant emplea la virtualización para poder aprovisionar las máquinas, lo que significa que necesitamos el software correspondiente previamente instalado en el servidor correspondiente o en la máquina en la que estemos lanzando el comando para aprovisionar. Más información en Vagrant

¿Como empezamos con el «proyecto»?

    • Creamos un directorio para dicho proyecto, el aprovisionamiento de la estructura necesaria para poder escribir el articulo [intlink id=»2817″ type=»post»]GlusterFS[/intlink]
    • Entramos en el directorio seleccionado y lanzamos el comando para establecer dicho directorio
    • cd GlusterFS
      vagrant init
      
    • En mi caso lo hago de esta forma
    • eloy@MacBookPro13~/vagrant $ mkdir GlusterFS
      eloy@MacBookPro13~/vagrant $ cd GlusterFS/
      eloy@MacBookPro13~/vagrant/GlusterFS $ vagrant init
      A `Vagrantfile` has been placed in this directory. You are now
      ready to `vagrant up` your first virtual environment! Please read
      the comments in the Vagrantfile as well as documentation on
      `vagrantup.com` for more information on using Vagrant.
      eloy@MacBookPro13~/vagrant/GlusterFS $ 
    • Como veis, al ejecutar el comando vagrant init, nos deja preparado dicho directorio con un fichero denominado Vagranfile que es justamente el fichero que vamos a emplear para el aprovisionamiento de las máquinas
    • Máquinas

    • Pues bien, comencemos echando un ojo al articulo del que partimos para determinar la infraestructura necesaria [intlink id=»2817″ type=»post»]GlusterFS[/intlink]. Parece que necesitaremos lo siguiente, 4 máquinas que van a hacer de servidor y un cliente, todas ellas linux y a ser posible 12.04 que es el sistema operativo que se empleó originalmente en el artículo (podria usar una distribución mas moderna pero da lo mismo y no es donde quiero que os centreis):
      • server1.casamier: IP 192.168.2.100 (servidor)
      • server2.casamier: IP 192.168.2.101 (servidor)
      • server3.casamier: IP 192.168.2.102 (servidor)
      • server4.casamier: IP 192.168.2.103 (servidor)
      • client1.casamier: IP 192.168.2.104 (cliente)
    • En esta instalación voy a hacer una pequeña modificación sobre la original, os cuento. Como podéis apreciar en la instalación original todas las máquinas estaban directamente conectadas a mi lan. Voy a hacer una sencilla modificación para hacer que todas las máquinas se levanten en una subred, de forma que queden organizadas y no se mezcle con las máquinas reales. La estructura que vamos a montar va a quedar de la siguiente forma:
      • server1.casamier: IP 192.168.0.100 (servidor) / Ubuntu SRV 12.04
      • server2.casamier: IP 192.168.0.101 (servidor) / Ubuntu SRV 12.04
      • server3.casamier: IP 192.168.0.102 (servidor) / Ubuntu SRV 12.04
      • server4.casamier: IP 192.168.0.103 (servidor) / Ubuntu SRV 12.04
      • client1.casamier: IP 192.168.0.104 (cliente) / Ubuntu 12.04
    • Puesto que ya hicimos la creación del directorio y ejecutamos el init, ya solo queda comenzar con las modificaciones en el fichero Vagrant, comenzamos
    • Editamos el fichero como siempre, y empezamos por la primera de las máquinas 192.168.5.100
    • Lo primero que necesitamos hacer es localizar en el catálogo de boxes un sistema que encaje con la infraestructura que queramos desplegar. La direccion del catálogo de boxes es https://atlas.hashicorp.com/boxes/search, posiblemente necesiteis una cuenta, no estoy seguro. En ese catálogo tenéis multitud de boxes a vuestra disposición, la mayor parte de ellos compartidos por la comunidad.
    • Entro en la zona de búsqueda para buscar «Ubuntu 12.04 server» y entre otros vemos que tenemos los siguientes:
      • ubuntu/precise64
      • ubuntu/precise32
    • Vamos a usar la versión de 64 y por lo tanto empleare ubuntu/precise64
    • Una vez localizado el box que quiero emplear para los servers me voy a de nuevo a editar Vagrantfile y lo añado de la siguiente forma
    • Vagrant.configure(2) do |config|
        # The most common configuration options are documented and commented below.
        # For a complete reference, please see the online documentation at
        # https://docs.vagrantup.com.
      
        # Every Vagrant development environment requires a box. You can search for
        # boxes at https://atlas.hashicorp.com/search.
        config.vm.box = "ubuntu/precise64"
      
    • Esa línea añadiría una sola máquina al entorno, pero sabemos que necesitamos 5, así que hay que complicarla un pelín, pero no mucho. Tal y como esta tenemos una máquina con ubuntu 64 server preparado, pero ni tenemos el resto de las máquinas, ni hemos instalado los paquetes necesarios, ni hemos configurado la red adecuadamente.
    • Vamos a añadir el resto de las máquinas. Procedo con la edición del fichero Vagranfile. Así queda con todas las máquinas necesarias:
    • ....
      Vagrant.configure(2) do |config|
        # The most common configuration options are documented and commented below.
        # For a complete reference, please see the online documentation at
        # https://docs.vagrantup.com.
      
        # Every Vagrant development environment requires a box. You can search for
        # boxes at https://atlas.hashicorp.com/search.
      
        config.vm.define "server1" do |server1|
          server1.vm.box = "ubuntu/precise64"
        end
        config.vm.define "server2" do |server2|
          server2.vm.box = "ubuntu/precise64"
        end
        config.vm.define "server3" do |server3|
          server3.vm.box = "ubuntu/precise64"
        end
        config.vm.define "server4" do |server4|
          server4.vm.box = "ubuntu/precise64"
        end
        config.vm.define "client1" do |client1|
          client1.vm.box = "ubuntu/precise64"
        end
      end
      .....
      
    • Como comentarios interesantes varios puntos
      • De un entorno con una sola máquina a uno con múltiples máquinas de alguna forma hay que poder referenciarlas, para eso se usan las variables server1, server2, server3, ….,client1
      • Cuando el entorno completo arranque tendremos que referirnos a las máquinas concretas en los comandos, por ejemplo para hacer un ssh contra la máquina server 1 tendremos que hacer vagrant ssh server1, tan sencillo como eso
      • De todo el conjunto de máquinas podemos definir una como principal de forma que los comandos anónimos vayan por defecto contra esa
      • Cuando levantemos el entorno, se levantarán por defecto todas las máquinas, pero hay formas de controlarlo de forma mas detallada
      • En estas condiciones ya tenemos las 5 máquinas funcionando, aunque falta la config concreta. Si ejecutamos un vagrant up en el directorio correspondiente debiéramos ver la siguiente salida
      • eloy@MacBookPro13~/vagrant/GlusterFS $ vagrant  up
        Bringing machine 'server1' up with 'virtualbox' provider...
        Bringing machine 'server2' up with 'virtualbox' provider...
        Bringing machine 'server3' up with 'virtualbox' provider...
        Bringing machine 'server4' up with 'virtualbox' provider...
        Bringing machine 'client1' up with 'virtualbox' provider...
        ==> server1: Box 'ubuntu/precise64' could not be found. Attempting to find and install...
            server1: Box Provider: virtualbox
            server1: Box Version: >= 0
        ==> server1: Loading metadata for box 'ubuntu/precise64'
            server1: URL: https://atlas.hashicorp.com/ubuntu/precise64
        ==> server1: Adding box 'ubuntu/precise64' (v20160519.1.3) for provider: virtualbox
            server1: Downloading: https://atlas.hashicorp.com/ubuntu/boxes/precise64/versions/20160519.1.3/providers/virtualbox.box
        ==> server1: Successfully added box 'ubuntu/precise64' (v20160519.1.3) for 'virtualbox'!
        ==> server1: Importing base box 'ubuntu/precise64'...
        ==> server1: Matching MAC address for NAT networking...
        ==> server1: Checking if box 'ubuntu/precise64' is up to date...
        ==> server1: Setting the name of the VM: GlusterFS_server1_1464342812043_40078
        ==> server1: Clearing any previously set forwarded ports...
        ==> server1: Fixed port collision for 22 => 2222. Now on port 2200.
        ==> server1: Clearing any previously set network interfaces...
        ==> server1: Preparing network interfaces based on configuration...
            server1: Adapter 1: nat
        ==> server1: Forwarding ports...
            server1: 22 (guest) => 2200 (host) (adapter 1)
        ==> server1: Booting VM...
        ==> server1: Waiting for machine to boot. This may take a few minutes...
            server1: SSH address: 127.0.0.1:2200
            server1: SSH username: vagrant
            server1: SSH auth method: private key
            server1: Warning: Remote connection disconnect. Retrying...
            server1: Warning: Remote connection disconnect. Retrying...
            server1: 
            server1: Vagrant insecure key detected. Vagrant will automatically replace
            server1: this with a newly generated keypair for better security.
            server1: 
            server1: Inserting generated public key within guest...
            server1: Removing insecure key from the guest if it's present...
            server1: Key inserted! Disconnecting and reconnecting using new SSH key...
        ==> server1: Machine booted and ready!
        ==> server1: Checking for guest additions in VM...
            server1: The guest additions on this VM do not match the installed version of
            server1: VirtualBox! In most cases this is fine, but in rare cases it can
            server1: prevent things such as shared folders from working properly. If you see
            server1: shared folder errors, please make sure the guest additions within the
            server1: virtual machine match the version of VirtualBox you have installed on
            server1: your host and reload your VM.
            server1: 
            server1: Guest Additions Version: 4.1.44
            server1: VirtualBox Version: 5.0
        ==> server1: Mounting shared folders...
            server1: /vagrant => /Users/eloy/vagrant/GlusterFS
        ==> server2: Box 'ubuntu/precise64' could not be found. Attempting to find and install...
            server2: Box Provider: virtualbox
            server2: Box Version: >= 0
        ...
            server2: /vagrant => /Users/eloy/vagrant/GlusterFS
        ==> server3: Box 'ubuntu/precise64' could not be found. Attempting to find and install...
            server3: Box Provider: virtualbox
            server3: Box Version: >= 0
        ...
            server3: /vagrant => /Users/eloy/vagrant/GlusterFS
        ==> server4: Box 'ubuntu/precise64' could not be found. Attempting to find and install...
            server4: Box Provider: virtualbox
            server4: Box Version: >= 0
        ...
            server4: /vagrant => /Users/eloy/vagrant/GlusterFS
        ==> client1: Box 'ubuntu/precise64' could not be found. Attempting to find and install...
            client1: Box Provider: virtualbox
            client1: Box Version: >= 0
        ==> client1: Loading metadata for box 'ubuntu/precise64'
            client1: URL: https://atlas.hashicorp.com/ubuntu/precise64
        ==> client1: Adding box 'ubuntu/precise64' (v20160519.1.3) for provider: virtualbox
        ==> client1: Importing base box 'ubuntu/precise64'...
        ==> client1: Matching MAC address for NAT networking...
        ==> client1: Checking if box 'ubuntu/precise64' is up to date...
        ==> client1: Setting the name of the VM: GlusterFS_client1_1464342992167_1902
        ==> client1: Clearing any previously set forwarded ports...
        ==> client1: Fixed port collision for 22 => 2222. Now on port 2204.
        ==> client1: Clearing any previously set network interfaces...
        ==> client1: Preparing network interfaces based on configuration...
            client1: Adapter 1: nat
        ==> client1: Forwarding ports...
            client1: 22 (guest) => 2204 (host) (adapter 1)
        ==> client1: Booting VM...
        ==> client1: Waiting for machine to boot. This may take a few minutes...
            client1: SSH address: 127.0.0.1:2204
            client1: SSH username: vagrant
            client1: SSH auth method: private key
            client1: Warning: Remote connection disconnect. Retrying...
            client1: Warning: Remote connection disconnect. Retrying...
            client1: 
            client1: Vagrant insecure key detected. Vagrant will automatically replace
            client1: this with a newly generated keypair for better security.
            client1: 
            client1: Inserting generated public key within guest...
            client1: Removing insecure key from the guest if it's present...
            client1: Key inserted! Disconnecting and reconnecting using new SSH key...
        ==> client1: Machine booted and ready!
        ==> client1: Checking for guest additions in VM...
            client1: The guest additions on this VM do not match the installed version of
            client1: VirtualBox! In most cases this is fine, but in rare cases it can
            client1: prevent things such as shared folders from working properly. If you see
            client1: shared folder errors, please make sure the guest additions within the
            client1: virtual machine match the version of VirtualBox you have installed on
            client1: your host and reload your VM.
            client1: 
            client1: Guest Additions Version: 4.1.44
            client1: VirtualBox Version: 5.0
        ==> client1: Mounting shared folders...
            client1: /vagrant => /Users/eloy/vagrant/GlusterFS
        eloy@MacBookPro13~/vagrant/GlusterFS $ 
      • Para parar las máquinas, desde el mismo directorio un simple vagrant halt
      • eloy@MacBookPro13~/vagrant/GlusterFS $ vagrant halt
        ==> client1: Attempting graceful shutdown of VM...
        ==> server4: Attempting graceful shutdown of VM...
        ==> server3: Attempting graceful shutdown of VM...
        ==> server2: Attempting graceful shutdown of VM...
        ==> server1: Attempting graceful shutdown of VM...
        eloy@MacBookPro13~/vagrant/GlusterFS $ 
        

        Red

    • Pasemos ahora a la configuración de la red. Vamos a configurar server1 y ver si funciona y luego atacamos la modificación del fichero vagrant completo
      • Comenzamos con el server1 y tenemos que darle la ip 192.168.0.100,respetando el rango de las redes privadas. Para ello modificamos Vagrantfile y ajustamos la configuración correspondiente a server1. Esa configuración queda de la siguiente forma:
      • config.vm.define "server1" do |server1|
            server1.vm.box = "ubuntu/precise64"
            server1.vm.network "private_network", ip: "192.168.0.100"
          end
        
      • Lo único que he hecho ha sido agregar para SERVER1 únicamente la configuración de la red privada de forma estática
      • Arranquemos server1 a ver si ha quedado correcto, empleamos el comando siguiente (si no especificamos el servidor se levantaría toda la estructura y no es lo que quiero)
      • vagrant up server1
        
        eloy@MacBookPro13~/vagrant/GlusterFS $ vagrant  up server1
        Bringing machine 'server1' up with 'virtualbox' provider...
        ==> server1: Checking if box 'ubuntu/precise64' is up to date...
        ==> server1: Clearing any previously set forwarded ports...
        ==> server1: Clearing any previously set network interfaces...
        ==> server1: Preparing network interfaces based on configuration...
            server1: Adapter 1: nat
            server1: Adapter 2: hostonly
        ==> server1: Forwarding ports...
            server1: 22 (guest) => 2222 (host) (adapter 1)
        ==> server1: Booting VM...
        ==> server1: Waiting for machine to boot. This may take a few minutes...
            server1: SSH address: 127.0.0.1:2222
            server1: SSH username: vagrant
            server1: SSH auth method: private key
            server1: Warning: Remote connection disconnect. Retrying...
            server1: Warning: Remote connection disconnect. Retrying...
        ==> server1: Machine booted and ready!
        ==> server1: Checking for guest additions in VM...
            server1: The guest additions on this VM do not match the installed version of
            server1: VirtualBox! In most cases this is fine, but in rare cases it can
            server1: prevent things such as shared folders from working properly. If you see
            server1: shared folder errors, please make sure the guest additions within the
            server1: virtual machine match the version of VirtualBox you have installed on
            server1: your host and reload your VM.
            server1: 
            server1: Guest Additions Version: 4.1.44
            server1: VirtualBox Version: 5.0
        ==> server1: Configuring and enabling network interfaces...
        ==> server1: Mounting shared folders...
            server1: /vagrant => /Users/eloy/vagrant/GlusterFS
        ==> server1: Machine already provisioned. Run `vagrant provision` or use the `--provision`
        ==> server1: flag to force provisioning. Provisioners marked to run always will still run.
        eloy@MacBookPro13~/vagrant/GlusterFS $
        
      • Si accedemos a server1 por ssh podremos comprobar que la interfaz de red se comporta como esperábamos
      • eloy@MacBookPro13~/vagrant/GlusterFS $ vagrant ssh server1
        Welcome to Ubuntu 12.04.5 LTS (GNU/Linux 3.2.0-102-virtual x86_64)
        ...
        vagrant@vagrant-ubuntu-precise-64:~$ ifconfig 
        ...
        eth1      Link encap:Ethernet  HWaddr 08:00:27:97:de:cc  
                  inet addr:192.168.0.100  Bcast:192.168.0.255  Mask:255.255.255.0
                  inet6 addr: fe80::a00:27ff:fe97:decc/64 Scope:Link
                  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
                  RX packets:0 errors:0 dropped:0 overruns:0 frame:0
                  TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
                  collisions:0 txqueuelen:1000 
                  RX bytes:0 (0.0 B)  TX bytes:468 (468.0 B)
        ...
        vagrant@vagrant-ubuntu-precise-64:~$
        
      • Procedamos con el resto de las modificaciones en el fichero Vagrantfile, queda así
      •   config.vm.define "server1" do |server1|
            server1.vm.box = "ubuntu/precise64"
            server1.vm.network "private_network", ip: "192.168.0.100"
          end
          config.vm.define "server2" do |server2|
            server2.vm.box = "ubuntu/precise64"
            server2.vm.network "private_network", ip: "192.168.0.101"
          end
          config.vm.define "server3" do |server3|
            server3.vm.box = "ubuntu/precise64"
            server3.vm.network "private_network", ip: "192.168.0.102"
          end
          config.vm.define "server4" do |server4|
            server4.vm.box = "ubuntu/precise64"
            server4.vm.network "private_network", ip: "192.168.0.103"
          end
          config.vm.define "client1" do |client1|
            client1.vm.box = "ubuntu/precise64"
            client1.vm.network "private_network", ip: "192.168.0.104"
          end
        

      Software adicional

      En el artículo original se indica que hay que instalar el software de glusterFS para poder configurar tanto los servidores como el cliente. Este paso también lo podemos abordar con vagrant, o incluso la propia configuración del mismo, pero en este articulo no voy a llegar a eso. En mi caso para la escritura del articulo solo lo hago 1 vez y no me merece la pena aunque desde el punto actual el esfuerzo es relativamente poco importante.

    • Voy a dejar todas las máquinas con el software preinstalado y listo para su uso. Para ello hay que volver a modificar el fichero Vagrantfile para indicarle que ejecute la instalación de ese software obviamente.
    • Para ello voy a emplear 2 scripts externos, uno para los servidores y otro mas para el cliente.
    • eloy@MacBookPro13~/vagrant/GlusterFS $ ls -lh
      total 24
      -rw-r--r--  1 eloy  staff   4,0K 27 may 12:40 Vagrantfile
      -rw-r--r--  1 eloy  staff   154B 27 may 12:41 glusterFS_client.sh
      -rw-r--r--  1 eloy  staff   154B 27 may 12:41 glusterFS_server.sh

    • El del server va a instalar el paquete necesario del server y lo mismo el del cliente para la máquina cliente.Los contenidos de cada uno de ellos son los siguientes:
    • eloy@MacBookPro13~/vagrant/GlusterFS $ cat glusterFS_server.sh 
      #!/usr/bin/env bash
      
      apt-get update
      
      apt-get install -y glusterfs-server
      
      eloy@MacBookPro13~/vagrant/GlusterFS $ cat glusterFS_client.sh 
      #!/usr/bin/env bash
      
      apt-get update
      
      apt-get install -y glusterfs-client
      
    • Ahora, por último, lo que queda es decir a cada máquina que es lo que tienen que hacer. Vagrantfile queda de la siguiente forma:
    • Vagrant.configure(2) do |config|
        # The most common configuration options are documented and commented below.
        # For a complete reference, please see the online documentation at
        # https://docs.vagrantup.com.
      
        # Every Vagrant development environment requires a box. You can search for
        # boxes at https://atlas.hashicorp.com/search.
      
        config.vm.define "server1" do |server1|
          server1.vm.box = "ubuntu/precise64"
          server1.vm.network "private_network", ip: "192.168.0.100"
          server1.vm.provision "shell", path: "glusterFS_server.sh"
        end
        config.vm.define "server2" do |server2|
          server2.vm.box = "ubuntu/precise64"
          server2.vm.network "private_network", ip: "192.168.0.101"
          server2.vm.provision "shell", path: "glusterFS_server.sh"
        end
        config.vm.define "server3" do |server3|
          server3.vm.box = "ubuntu/precise64"
          server3.vm.network "private_network", ip: "192.168.0.102"
          server3.vm.provision "shell", path: "glusterFS_server.sh"
        end
        config.vm.define "server4" do |server4|
          server4.vm.box = "ubuntu/precise64"
          server4.vm.network "private_network", ip: "192.168.0.103"
          server4.vm.provision "shell", path: "glusterFS_server.sh"
        end
        config.vm.define "client1" do |client1|
          client1.vm.box = "ubuntu/precise64"
          client1.vm.network "private_network", ip: "192.168.0.104"
          client1.vm.provision "shell", path: "glusterFS_client.sh"
        end
      ....
      
    • Probemos con server1 a levantarlo para ver si todo funciona adecuadamente
    • Levantamos con vagrant up server1
    • eloy@MacBookPro13~/vagrant/GlusterFS $ vagrant  up server1
      Bringing machine 'server1' up with 'virtualbox' provider...
      ==> server1: Checking if box 'ubuntu/precise64' is up to date...
      ==> server1: VirtualBox VM is already running.
      eloy@MacBookPro13~/vagrant/GlusterFS $ vagrant  halt server1
      ==> server1: Attempting graceful shutdown of VM...
      eloy@MacBookPro13~/vagrant/GlusterFS $ vagrant  up server1
      Bringing machine 'server1' up with 'virtualbox' provider...
      ==> server1: Checking if box 'ubuntu/precise64' is up to date...
      ...
          server1: 22 (guest) => 2222 (host) (adapter 1)
      ==> server1: Booting VM...
      ==> server1: Waiting for machine to boot. This may take a few minutes...
          server1: SSH address: 127.0.0.1:2222
          server1: SSH username: vagrant
          server1: SSH auth method: private key
      ....
          server1: /vagrant => /Users/eloy/vagrant/GlusterFS
      ==> server1: Machine already provisioned. Run `vagrant provision` or use the `--provision`
      ....
      
    • Aprovisionemos la máquina con el script ejecutando vagrant provision server1
    • eloy@MacBookPro13~/vagrant/GlusterFS $ vagrant  provision server1
      ==> server1: Running provisioner: shell...
          server1: Running: /var/folders/n3/3wywf5695blc96fwcxbd451h0000gn/T/vagrant-shell20160527-4583-49hlar.sh
      ==> server1: stdin: is not a tty
      ==> server1: Get:1 http://security.ubuntu.com precise-security Release.gpg [198 B]
      ...
      ==> server1: Hit http://archive.ubuntu.com precise-backports/universe Translation-en
      ==> server1: Fetched 11.3 MB in 8s (1,393 kB/s)
      ==> server1: Reading package lists...
      ==> server1: Reading package lists...
      ==> server1: Building dependency tree...
      ==> server1: Reading state information...
      ==> server1: The following extra packages will be installed:
      ==> server1:   fuse-utils glusterfs-client glusterfs-common libibverbs1
      ==> server1: Suggested packages:
      ==> server1:   glusterfs-examples
      ==> server1: The following NEW packages will be installed:
      ==> server1:   fuse-utils glusterfs-client glusterfs-common glusterfs-server libibverbs1
      ==> server1: 0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
      ==> server1: Need to get 9,420 kB of archives.
      ...
      ==> server1: Setting up glusterfs-common (3.2.5-1ubuntu1) ...
      ==> server1: Setting up glusterfs-client (3.2.5-1ubuntu1) ...
      ==> server1: Setting up glusterfs-server (3.2.5-1ubuntu1) ...
      ==> server1: glusterfs-server start/running, process 2048
      ==> server1: Processing triggers for libc-bin ...
      ==> server1: ldconfig deferred processing now taking place
      eloy@MacBookPro13~/vagrant/GlusterFS $ 
      
    • No voy a levantar completamente el entorno, porque el trabajo ya esta hecho, lo dejo para que lo hagáis en vuestra casa…..con vagrant status dentro del directorio del proyecto podeis ver todas las máquinas levantadas sin problema
    • eloy@MacBookPro13~/vagrant/GlusterFS $ vagrant  status
      Current machine states:
      
      server1                   running (virtualbox)
      server2                   running (virtualbox)
      server3                   running (virtualbox)
      server4                   running (virtualbox)
      client1                   running (virtualbox)
      
      This environment represents multiple VMs. The VMs are all listed
      above with their current state. For more information about a specific
      VM, run `vagrant status NAME`.
      
    • Finalmente tenemos toda la infraestructura preparada. Al lanzar el entorno se instalarán los paquetes en las máquinas correspondientes, dejando la infraestructura lista para, en mi caso, escribir el articulo
    • Para lanzar el entorrno con las instalaciones de software necesarias podemos ejecutar con un solo comando
    • vagrant up --provision
      
    • o bien con dos comandos diferentes
    • vagrant up
      ...
      vagrant provision
      

    Muchas gracias a todos y un saludo.

You must be logged in to post a comment.