-
Notifications
You must be signed in to change notification settings - Fork 1
Manager Base
Johnny Foulds edited this page Aug 18, 2019
·
7 revisions
The page describes how the base Hadoop Manager Virtual Machine is created from which the nodes will be cloned.
# connect to the vCenter server
$server = Connect-VIServer -Verbose:$true -Server $vCenterHostName -User $vCenterUser -Password $vCenterPassword
$vm = Get-VM -Server $server -Name "Base Linux Machine"
$snapshot = Get-Snapshot -VM $vm -Name "Clean Install"
# create the manager machine based on the snapshot
$cloneParams = @{
'Name' = 'Hadoop Manager Node'
'Datastore' = $datastore
'VM' = $vm
'DiskStorageFormat' = 'Thin'
'VMHost' = $vmHost
'LinkedClone' = $null
'ReferenceSnapshot' = $snapshot
}
# clone the vm
$managerVM = New-VM @cloneParams
# add cpu cores and memory
Set-VM -VM $managerVM -NumCpu 4 -MemoryGB 8 -Confirm:$false
# start the virtual machine
Start-VM -VM $managerVM
- Using the VM console log in as root and type
ip addr | grep ens
to get the name of the network adapter. - Bring the interface up using this name, for example:
ifup ens192
- Use the first command (
ip addr | grep ens
) again to get the ip address that can be used to SSH into the host. - SSH into the host (
ssh [email protected]
) and then typeexit
. - Using the IP Address execute the following command with the appropriate parameters to configure the manager node with the help of the config scripts.
./config-manager.sh -u root -p '[YOUR_PASSWORD]' -s 192.168.3.161 -i 192.168.3.200 -h "hadoop-manager.lan" -d 192.168.3.1 -g 192.168.3.1 -n 255.255.255.0
Shut down the manager node and create a snapshot:
# connect to the vCenter server
$server = Connect-VIServer -Verbose:$true -Server $vCenterHostName -User $vCenterUser -Password $vCenterPassword
# create a snapshot of the base machine
$vm = Get-VM -Server $server -Name "Hadoop Manager Node"
New-Snapshot -Server $server -VM $vm -Name "Manager Base Config" -Description "Hadoop Manager Node Base Config" -Quiesce
- SSH tip: Send commands remotely - https://www.cnet.com/news/ssh-tip-send-commands-remotely/
- How to Use SCP Command to Securely Transfer Files - https://linuxize.com/post/how-to-use-scp-command-to-securely-transfer-files/
- How To Run Shell Script or Command On Remote With SSH - https://www.poftut.com/run-shell-script-command-remote-ssh/
- Bash scripting cheatsheet - https://devhints.io/bash
- Getopts - https://www.shellscript.sh/tips/getopts/
- BASH command output to the variable - https://linuxhint.com/bash_command_output_variable/
- Bash tips: Colors and formatting - https://misc.flogisoft.com/bash/tip_colors_and_formatting
- How to use sed to find and replace text in files in Linux - https://www.cyberciti.biz/faq/how-to-use-sed-to-find-and-replace-text-in-files-in-linux-unix-shell/
- How to Set or Change Hostname in CentOS 7 - https://www.tecmint.com/set-change-hostname-in-centos-7/