Skip to content

cs-course/minidc-tutorial

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

2+1 nodes cluster, node image based on ubuntu-focal.

Hosts:

  1. controller: 192.168.33.20
  2. node1: 192.168.33.21
  3. node2: 192.168.33.22

All machines are connected by a host-only network.

Each with 1GB memory and 2 cores, for 4 core hosts, the minimal setup could be controller + node1.

Get and Manage Boxes

To manage metadata for downloaded box files:

reference

Example:

{
    "name": "ubuntu/focal64",
    "versions": [{
        "version": "20200618.0.0",
        "providers": [{
            "name": "virtualbox",
            "url": "focal-server-cloudimg-amd64-vagrant.box"
        }]
    }]
}

Add downloaded box using metadata file with box version (without this file, all imported box will begin versioning from 0):

vagrant box add foo.json

Check it out:

vagrant box list

A Brief Course on Vagrant

Hello World!

The 1st run step-1.

Name it!

Name the virtual machine step-2.

CPU and Memory

Set CPU cores and memory (using VirtualBox provider) step-3.

Private Network

Add a host-only network step-4.

Public Network

Bridge to chosen host network step-5.

Provision

Do something more to prepare the virtual machine step-6.

SSH Made Easy

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.

Zhan.Shi @ 2017-2020

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%