-
Notifications
You must be signed in to change notification settings - Fork 48
BasicSetup
This setup makes use of the Vagrant module, a pseudo-cookbook which is responsible for local environment provisioning using Vagrant (powered by Chef + Berkshelf under the hood).
Currently a virtual machine with the following services is created:
- Karaf
- Apache
- Tomcat
- ActiveMQ
- MongoDb
- Brosermob
- Firefox
- X environment
All services run using default ports. For communication please use the following IP address:
192.168.123.100
By default the Vagrant virtual machine needs 3 GB of RAM and 2 vCPUs, so please make sure that you have enough memory on your machine (8 GB is minimum, 16 GB is recommended though).
- Download and install VirtualBox 5.1.30
- Download and install Vagrant 1.9.2
- Download and install ChefDK 2.4.17
As the administrator execute the following commands:
vagrant plugin install vagrant-omnibusvagrant plugin install vagrant-berkshelfvagrant plugin install vagrant-hostmanager
Whenever you'd like to keep all Vagrant related data and virtual machine disks in non-standard directories please:
- set the
VAGRANT_HOMEvariable for the location (by default it is set to$HOME/vagrant.d). - update VirtualBox settings (
File -> Preferences -> General) to move all disks to other directory.
Once you set all the thigs described above just execute:
berks update && vagrant destroy -f && vagrant up
All the commands need to be executed when you're inside a directory that contains Vagrantfile.
Next you will need to execute:
-
berks install- downloads Chef dependencies from external sources. It acts asmvn clean install, but for Chef cookbooks. -
vagrant up- creates a new virtual machine (the.boxfile will be downloaded during the first run), runs Chef inside it, sets domains and port forwarding up.
Whenever a new version is released please execute the following:
-
git pullto get the latest version ofVagrantfile. -
berks updateto update Chef dependencies. -
vagrant provisionto re-run Chef on the virtual machine.
To access the virtual machine via SSH please execute vagrant ssh from the same directory that contains Vagrantfile. After that please type sudo -i and press ENTER to switch to root.
If you prefer to use PuTTY, mRemote or any other connection manager, please log in as the user vagrant with the password vagrant on localhost with the port 2222. Keep in mind that the port may be different if you have more than one Vagrant machine running at the same time. You can check the current assignment by executing the vagrant ssh-config command from the directory that contains your Vagrantfile.
-
vagrant reloadrestarts the Vagrant machine and re-applies settings defined inVagrantfile. It's useful whenever you've changed the port forwarding or synced folder configuration. -
vagrant destroy -fdeletes the entire virtual machine. -
vagrant reload --provisionrestarts the virtual machine and re-runs Chef afterwards. -
vagrant suspendsuspends the virtual machine that is currently running. -
vagrant resumeresumes the suspended virtual machine. -
vagrant statusshows the status of the virtual machine described inVagrantfile. -
vagrant halthalts/turns off the virtual machine.
The local port is a port exposed on your machine. You can access services via localhost:<PORT>.
The VM port refers to the port assigned inside the Vagrant virtual machine.
Port forwarding rules can be easily changed in Vagrantfile.
| Local port | VM port | Description |
|---|---|---|
| 8181 | 8181 | Karaf |
- When getting the following error during application deployment to the local Vagrant:
run the
What went wrong: Execution failed for task ':deployDevClearCache'. > java.net.ConnectException: Connection timed out: connectifup eth1command on Vagrant using ssh.
-
How To Use
-
Releases