-
Notifications
You must be signed in to change notification settings - Fork 1
Worker Nodes
Johnny Foulds edited this page Aug 19, 2019
·
2 revisions
This page describes how the worked nodes are created.
function New-WorkerNode([string]$name) {
$cloneParams = @{
'Name' = $name
'Datastore' = $datastore
'VM' = $vm
'DiskStorageFormat' = 'Thin'
'VMHost' = $vmHost
'LinkedClone' = $null
'ReferenceSnapshot' = $snapshot
}
# clone the vm
$workerVM = New-VM @cloneParams
# add cpu cores and memory
Set-VM -VM $workerVM -NumCpu 2 -MemoryGB 2 -Confirm:$false
}
# connect to the vCenter server
$server = Connect-VIServer -Verbose:$true -Server $vCenterHostName -User $vCenterUser -Password $vCenterPassword
# get the manager node and snapshot to create the clones form
$vm = Get-VM -Server $server -Name "Hadoop Manager Node"
$snapshot = Get-Snapshot -VM $vm -Name "Manager Base Config"
# create the three worker nodes
New-WorkerNode -name "Hadoop Worker Node 01"
New-WorkerNode -name "Hadoop Worker Node 02"
New-WorkerNode -name "Hadoop Worker Node 03"
At this point all the nodes for the cluster is configured to have the same IP address and hostname and have to be re-configured individually. So first make sure all the VMs are shut down with the following script:
Get-VM -Server $server -Name "Hadoop Manager Node" | Shutdown-VMGuest -Confirm:$false
Get-VM -Server $server -Name "Hadoop Worker Node 01" | Shutdown-VMGuest -Confirm:$false
Get-VM -Server $server -Name "Hadoop Worker Node 02" | Shutdown-VMGuest -Confirm:$false
Get-VM -Server $server -Name "Hadoop Worker Node 03" | Shutdown-VMGuest -Confirm:$false
Start each node one at a time, execute the configuration script below, then repeat for the remaining worker nodes.
Get-VM -Server $server -Name "Hadoop Worker Node [NODE_ID]" | Start-VM
./config-manager.sh -u root -p '[YOUR_PASSWORD]' -s 192.168.3.200 -i 192.168.3.2[NODE_ID] -h "hadoop-worker[NODE_ID].lan" -d 192.168.3.1 -g 192.168.3.1 -n 255.255.255.0