落地并存测服全端:智能体 Graph/路由、后台切 8180、主账与部署脚本齐备,便于线上重发与验收。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
# TCP 探测 Redis,不打印口令
|
||||
$ErrorActionPreference = 'Continue'
|
||||
function Test-Port($h, $p) {
|
||||
try {
|
||||
$tcp = New-Object System.Net.Sockets.TcpClient
|
||||
$iar = $tcp.BeginConnect($h, [int]$p, $null, $null)
|
||||
$ok = $iar.AsyncWaitHandle.WaitOne(3000, $false)
|
||||
if (-not $ok) { $tcp.Close(); return "TIMEOUT $h`:$p" }
|
||||
$tcp.EndConnect($iar)
|
||||
$tcp.Close()
|
||||
return "OPEN $h`:$p"
|
||||
} catch {
|
||||
return "FAIL $h`:$p $($_.Exception.Message)"
|
||||
}
|
||||
}
|
||||
Write-Output (Test-Port '127.0.0.1' 6379)
|
||||
Write-Output (Test-Port '10.206.0.14' 6379)
|
||||
Write-Output (Test-Port '10.206.0.15' 6379)
|
||||
Write-Output (Test-Port '10.206.0.14' 3306)
|
||||
|
||||
# 从 REDIS_URL 解析 host
|
||||
$raw = (Get-Content 'E:\wwwroot\.env' | Where-Object { $_ -match '^REDIS_URL=' } | Select-Object -First 1)
|
||||
if ($raw) {
|
||||
if ($raw -match '@([^:/]+):(\d+)/(\d+)') {
|
||||
Write-Output ("url_host=" + $Matches[1] + " port=" + $Matches[2] + " db=" + $Matches[3])
|
||||
Write-Output (Test-Port $Matches[1] $Matches[2])
|
||||
}
|
||||
}
|
||||
Write-Output 'TCP_DONE'
|
||||
Reference in New Issue
Block a user