Commit 7fc51797 authored by Anthony Lapenna's avatar Anthony Lapenna

Merge branch 'vagrant' into 5-vagrant

parents 6bb0b536 808f8d0d
.vagrant/
.idea/
......@@ -97,6 +97,18 @@ By default, the stack exposes the following ports:
*WARNING*: If you're using *Docker Toolbox*, you must access it via the *docker-machine* IP address instead of *localhost*.
## Running the ELK stack in a Vagrant VM
If you want to learn or try the ELK stack in Windows, OSX or other OS. You can run the stack in a vagrant VM.
Prerequisite:[Vagrant](https://www.vagrantup.com/downloads.html) and [VirtualBox](https://www.virtualbox.org/wiki/Downloads).
```SHELL
git clone https://github.com/deviantony/docker-elk.git
cd docker-elk
vagrant up
```
# Configuration
*NOTE*: Configuration is not dynamically reloaded, you will need to restart the stack after any change in the configuration of a component.
......
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.provider "virtualbox" do |v|
v.name = "ELK_vagrant"
v.memory = 4096
v.cpus = 2
end
config.vm.box_check_update = true
config.vm.network "forwarded_port", guest: 5000, host: 5000
config.vm.network "forwarded_port", guest: 5601, host: 5601
config.vm.network "forwarded_port", guest: 9200, host: 9200
config.vm.network "forwarded_port", guest: 9300, host: 9300
#SSH
config.ssh.forward_agent = true
config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'"
#Provision
config.vm.provision "shell", inline: <<-SHELL
sudo touch /var/lib/cloud/instance/locale-check.skip
sudo apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo sh -c 'echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" > /etc/apt/sources.list.d/docker.list'
sudo apt-cache policy docker-engine
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y docker-engine python-pip
sudo pip install docker-compose
sudo usermod -aG docker vagrant
sudo -u vagrant pip install docker-compose
sudo docker-compose -f /vagrant/docker-compose.yml up -d
SHELL
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment