3 nodes cluster, node image based on ubuntu-xenial-docker
With docker running on each node, this virtual cluster can support multiple distributed software configuration at ease.
Hosts:
- node1: 192.168.33.21
- node2: 192.168.33.22
- node3: 192.168.33.23
All machines are connected by a host-only network.
To download base image directly:
Example, the one used in this Vagrant project:
To manage metadata for downloaded box files:
Example:
{
"name": "envimation/ubuntu-xenial-docker",
"description": "This box contains Ubuntu 16.04 LTS 64-bit with docker.",
"versions": [{
"version": "1.0.0-1502068394",
"providers": [{
"name": "virtualbox",
"url": "ubuntu-xenial-docker.box"
}]
}]
}Add downloaded box by metadata:
vagrant box add foo.jsonCheck it out:
vagrant box listThe 1st run step-1.
Name the virtual machine step-2.
Set CPU cores and memory (using VirtualBox provider) step-3.
Add a host-only network step-4.
Bridge to chosen host network step-5.
Do something more to prepare the virtual machine step-6.
To prepare or regenerate your own key pair:
ssh-keygen -f insecure-key -N ''SSH access by key pair:
ssh -i insecure-key vagrant@{IP}Ignore host checking during first time login (potential MITM attack):
ssh -i insecure-key -o StrictHostKeyChecking=no vagrant@{IP}Furthermore, force no password input:
ssh -i insecure-key -o StrictHostKeyChecking=no -o PasswordAuthentication=no vagrant@{IP}Then VMs should be re-created to apply new keys.
Project resides in current directory, refer to Vagrantfile.
Refer to cluster-120/Vagrantfile-00{1..4}.
All machines are connected through bridged network, thus became public accessible.
TODO: use command line augments to unify physical cluster configuration.
Zhan.Shi @ 2017