Az egyik laborunkban feladatátvételi fürtöket próbálnak ki a hallgatók a gyakorlatban, ehhez a megvalósítást a Windows Serverben elérhető Failover Clustering funkció adja. Idén Windows Server 2012-t használunk már, de ehhez a teljes virtuális gépekből álló környezetet újra össze kellett építeni. Ha már úgyis az új szervert használjuk, akkor gondoltam kipróbálom a Server Core opciót: tehát nincs GUI, csak PowerShell segítségével végezzük el a beállításokat. Elvileg most már a feladatok nagy részét meg lehet így is oldani, lássuk milyen lett az új Server Core. Tehát a kihívás a következő: a fürt létrehozása előtti alap beállításokat csak PowerShell parancsok segítségével lehet elvégezni.
Öt darab virtuális gépre volt szükség: egy tartományvezérlő (DC), egy közös tárhelyet biztosító iSCSI kiszolgáló és három darab csomópont a fürthöz.
Pár lépést elvégeztem a közös ősként szolgáló virtuális gépen:
# Remove unnecessary features, features can be completly removed with Features on Demand
Uninstall-WindowsFeature -Remove -IncludeManagementTools -Name AD-Certificate, ADLDS, ADRMS, Hyper-V, Print-Services, RemoteAccess, Remote-Desktop-Services, VolumeActivation, Web-Server, UpdateServices, BitLocker, BranchCache, NFS-Client, Data-Center-Bridging, GPMC, ManagementOdata, Server-Media-Foundation, MSMQ, qWave, RSAT, SNMP-Service, Subsystem-UNIX-Apps, Telnet-Client, WFF, Windows-Server-Backup, Migration
# run windows update
wuauclt /detectnow
#set date & time
Control timedate.cpl
# download PowerShell help
Update-Help
# set administrator password: no expiration
Get-CimInstance -ClassName Win32_UserAccount -Filter "name = 'Administrator'" | Set-CimInstance -Property @{PasswordExpires="False"}
#disable automatic activation
cd "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform"
Set-ItemProperty .\Activation -Name Manual -Value 1
# allow incoming IPv4 echo request (ping)
Set-NetFirewallRule -Name FPS-ICMP4-ERQ-In -Enabled True
A következő lépés a tartományvezérlő beállítása:
# NOTE: if using linked clone virtual machines, the SID of the machine used as the DC should be changed, # because the domain will get that SID for the domain SID, and hence the other machines would not be # able to join the domain throwing an ERROR_DOMAIN_SID_SAME_AS_LOCAL_WORKSTATION error Rename-Computer -NewName DC1 Restart-Computer # rename network adapter Get-NetAdapter | Rename-NetAdapter -NewName lan # disable IPv6 Set-NetAdapterBinding -Name "lan" -ComponentID ms_tcpip6 -Enabled $False # add new static IP address New-NetIPAddress -InterfaceAlias lan -AddressFamily IPv4 -PrefixLength 24 -IPAddress 192.168.170.11 # set local server for DNS server for LAN adapter Set-DnsClientServerAddress -InterfaceAlias lan -ServerAddresses "127.0.0.1" # get the index of the install image of the Standard/Datacenter version in the wim # use this index with feature install, in this example the index is 1 Get-WindowsImage -ImagePath D:\sources\install.wim # install the binaries for AD DS Install-WindowsFeature -Name AD-Domain-Services -Source wim:D:\sources\install.wim:1 # install the DNS feature as it will be used Install-WindowsFeature -Name DNS -Source wim:D:\sources\install.wim:1 # install a new AD forest and a domain in it, this will prompt for AD restore password Install-ADDSForest -DomainName clusterdemo.local -ForestMode Win2012 -InstallDns:$True –NoRebootOnCompletion:$True -CreateDnsDelegation:$false Restart-Server # after restart, test that DNS install was successfull Get-DnsServerZone clusterdemo.local | Get-DnsServerResourceRecord # create an AD integrated reverse lookup zone Add-DnsServerPrimaryZone -ReplicationScope Domain -NetworkId "192.168.170/24" -DynamicUpdate Secure # add a new PTR record in the zone Add-DnsServerResourceRecordPtr -ZoneName "170.168.192.in-addr.arpa" -Name 10 -PtrDomainName "dc1.clusterdemo.local"
Ezután jöhetnek a fürt csomópontjai (ezeknek három darab hálózati kártyájuk van, egy a DC felé, egy a közös tárhely felé és egy belső kapcsolat a fürttagok között):
# the nodes are called FC-NODE1, FC-NODE2, FC-NODE3, substitute X with the actual number
Rename-Computer FC-NODEX
Restart-Computer
# set networking
# create a net.csv file with the network settings
Write-Output "oldname,newname,ip" > net.csv
Write-Output "Ethernet,lan,192.168.170.2X" >> net.csv
Write-Output "Ethernet 3,private,192.168.100.2X" >> net.csv
Write-Output "Ethernet 2,storage,192.168.50.2X" >> net.csv
# set names and addresses
Import-Csv .\net.csv | % {Rename-NetAdapter -NewName $_.newname -Name $_.oldname; New-NetIPAddress -InterfaceAlias $_.newname -IPAddress $_.ip -AddressFamily IPv4 -PrefixLength 24; Set-NetAdapterBinding -Name $_.newname -ComponentID ms_tcpip6 -Enabled $False}
# Set DC1 as the DNS server
Set-DnsClientServerAddress -InterfaceAlias lan -ServerAddresses "192.168.170.11"
# disable Teredo tunneling pseudo-interface
Get-NetAdapter –InterfaceAlias "Teredo Tunneling Pseudo-Interface" -IncludeHidden | Disable-NetAdapter
# add failover clustering feature
Install-WindowsFeature -Name Failover-Clustering -Source wim:D:\sources\install.wim:1
# Add file server role, which will be later needed
Install-WindowsFeature FS-FileServer -Source wim:D:\sources\install.wim:1
# start the iSCSI Initiator service
Set-Service -Name msiscsi -StartupType Automatic
Start-Service msiscsi
# enable firewall rules for iSCSI Initiator
Get-NetFirewallRule -DisplayGroup "iSCSI Service" | Set-NetFirewallRule -Enabled True
# join to domain
Add-Computer -DomainCredential clusterdemo\administrator -DomainName clusterdemo.local
És már készen is áll a rendszerünk a fürt telepítésére:). Most már csak legközelebb az egészet automatizálni kéne PowerShell workflow formájában…