Wie kann ich den Enginsight Pulsar automatisch auf mehreren persistenten Windows-Systemen ausrollen?
2
4
7
Skript für die Provisionierung abspeichern und ausführen
param ($hosts, $accessKeyId, $accessKeySecret, $outFolder=".")
if ($hosts -eq $null) {
throw "Must provide a file (-hosts) with line-by-line hostnames to create configs for"
}
if (($accessKeyId -eq $null) -or ($accessKeySecret -eq $null)) {
throw "Must provide credentials (-accessKeyId, -accessKeySecret) suitable for Pulsar installation"
}
Write-Host "Creating configs for hosts from ${hosts} in `"${outFolder}`", using existing config.json as template"
if (-not (Test-Path -Path $outFolder)) {
Write-Host "${outFolder} does not exist, creating it"
try {
New-Item -ItemType Directory -Path $outFolder | Out-Null
} catch {
throw "Failed to create output folder`n$_"
}
}
try {
$configTemplate = Get-Content -Raw -Path "C:\Program Files\Enginsight\Pulsar\config.json" | ConvertFrom-Json
} catch {
throw "Failed to read C:\Program Files\Enginsight\Pulsar\config.json - is Pulsar installed properly?`n$_"
}
$args = "-install","-accessKeyId",$accessKeyId,"-accessKeySecret",$accessKeySecret,"-license",$configTemplate.license,
"-api",$configTemplate.api.url
if ($configTemplate.api.proxy -ne "") {
$args += "-proxy",$configTemplate.api.proxy,"-noProxy",$configTemplate.api.noProxy
}
foreach($hostname in Get-Content $hosts) {
$hostname = $hostname.Trim()
if ($hostname -eq "") {
continue
}
$outFile = Join-Path -Path ${outFolder} -ChildPath "config_${hostname}.json"
if (Test-Path -Path $outFile) {
Write-Error "Configuration for host ${hostname} already exists at ${outFile}, skipping"
continue
}
$proxyParams = ""
Write-Host "Creating config for host ${hostname}"
& "C:\Program Files\Enginsight\Pulsar\ngs-pulsar-amd64.exe" @args
if (-not ($?)) {
throw "Failed to create config for ${hostname}"
}
try {
$config = Get-Content -Raw -Path "C:\Program Files\Enginsight\Pulsar\config.json" | ConvertFrom-Json
$config.override = $configTemplate.override
if ($configTemplate.tieredTransactionLog -ne $null) {
$config.tieredTransactionLog = $configTemplate.tieredTransactionLog
}
} catch {
throw "Failed to read newly created config file`n$_"
}
try {
$config | ConvertTo-Json -Depth 4 | Set-Content -Path $outFile -Encoding UTF8NoBOM
Write-Host "Successfully created config for ${hostname} at ${outFile}"
} catch {
throw "Failed to write config for ${hostname} to ${outFile}`n$_"
}
}C:\Programme\Enginsight\Pulsar\provision.ps1& "C:\Program Files\Enginsight\Pulsar\provision.ps1" -hosts "<PfadZurHostsDatei>\<HostsDateiname>.txt" -accessKeyId "<AccessKeyID>" -accessKeySecret "<AccessKeySecret>"8
Pulsar-Dienste auf jedem Host starten und Starttyp anpassen
cp "<PfadZurKonfigurationsdatei>\config_${env:computername}.json" "C:\Program Files\Enginsight\Pulsar\config.json"
Start-Service "Enginsight Pulsar"
Set-Service -Name "Enginsight Pulsar" -StartupType Automatic
Set-Service -Name "Enginsight Supervisor" -StartupType AutomaticWeitere Ressourcen
VorherigeWie kann ich den Enginsight Pulsar manuell auf mehreren persistenten Windows-VMs ausrollen?NächsteWie konfiguriere ich in Enginsight die gestaffelte Zwischenspeicherung von Pulsar-Daten?
Zuletzt aktualisiert
War das hilfreich?