refactor: rename ScadaLink → ZB.MOM.WW.ScadaBridge (code + projects + namespaces)
Solution + 23 src projects + 26 test projects renamed; folders, csproj, namespaces, and ScadaLinkDbContext/ScadaBridgeDbContext class updated. ActorSystem "scadalink" → "scadabridge", Akka seed-node URLs migrated. SQL roles/logins, LDAP domains, CLI command name, and CLI config dir (~/.scadalink → ~/.scadabridge) also renamed. Build green; 5 Host.Tests fail awaiting SQL login rename in next commit. Pre-existing StaleTagMonitor timing flakes unchanged. Rename script committed at tools/rename-to-scadabridge.sh.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# ScadaLink Failover Procedures
|
||||
# ScadaBridge Failover Procedures
|
||||
|
||||
## Automatic Failover (No Intervention Required)
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
1. Restore SQL Server access.
|
||||
2. Central nodes will automatically reconnect (EF Core connection resiliency).
|
||||
3. Verify `/health/ready` returns 200.
|
||||
4. No manual intervention needed on ScadaLink nodes.
|
||||
4. No manual intervention needed on ScadaBridge nodes.
|
||||
|
||||
### Scenario 5: Forced Singleton Migration
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
|
||||
**Procedure:**
|
||||
1. Initiate graceful shutdown on the degraded node:
|
||||
- Stop the Windows Service: `sc.exe stop ScadaLink-Central`
|
||||
- Stop the Windows Service: `sc.exe stop ScadaBridge-Central`
|
||||
- CoordinatedShutdown will migrate singletons to the standby.
|
||||
2. Wait for the standby to take over (check logs for "Singleton acquired").
|
||||
3. Fix the issue on the original node.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# ScadaLink Maintenance Procedures
|
||||
# ScadaBridge Maintenance Procedures
|
||||
|
||||
## SQL Server Maintenance (Central)
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
```sql
|
||||
-- Rebuild fragmented indexes on configuration database
|
||||
USE ScadaLink;
|
||||
USE ScadaBridge;
|
||||
EXEC sp_MSforeachtable 'ALTER INDEX ALL ON ? REBUILD WITH (ONLINE = ON)';
|
||||
```
|
||||
|
||||
@@ -43,8 +43,8 @@ Consider partitioning the AuditLogEntries table by month for efficient purging.
|
||||
|
||||
```sql
|
||||
-- Check database sizes
|
||||
EXEC sp_helpdb 'ScadaLink';
|
||||
EXEC sp_helpdb 'ScadaLink_MachineData';
|
||||
EXEC sp_helpdb 'ScadaBridge';
|
||||
EXEC sp_helpdb 'ScadaBridge_MachineData';
|
||||
|
||||
-- Check table sizes
|
||||
SELECT
|
||||
@@ -72,7 +72,7 @@ ORDER BY TotalSpaceMB DESC;
|
||||
|
||||
```powershell
|
||||
# Check SQLite file sizes
|
||||
Get-ChildItem C:\ScadaLink\data\*.db | Select-Object Name, @{N='SizeMB';E={[math]::Round($_.Length/1MB,2)}}
|
||||
Get-ChildItem C:\ScadaBridge\data\*.db | Select-Object Name, @{N='SizeMB';E={[math]::Round($_.Length/1MB,2)}}
|
||||
```
|
||||
|
||||
### S&F Database Growth
|
||||
@@ -92,14 +92,14 @@ The S&F database has **no max buffer size** by design. During extended outages,
|
||||
SQLite does not reclaim disk space after deleting rows. Periodically vacuum:
|
||||
|
||||
```powershell
|
||||
# Stop the ScadaLink service first
|
||||
sc.exe stop ScadaLink-Site
|
||||
# Stop the ScadaBridge service first
|
||||
sc.exe stop ScadaBridge-Site
|
||||
|
||||
# Vacuum the S&F database
|
||||
sqlite3 C:\ScadaLink\data\store-and-forward.db "VACUUM;"
|
||||
sqlite3 C:\ScadaBridge\data\store-and-forward.db "VACUUM;"
|
||||
|
||||
# Restart the service
|
||||
sc.exe start ScadaLink-Site
|
||||
sc.exe start ScadaBridge-Site
|
||||
```
|
||||
|
||||
**Important:** Only vacuum when the service is stopped. SQLite does not support concurrent vacuum.
|
||||
@@ -108,16 +108,16 @@ sc.exe start ScadaLink-Site
|
||||
|
||||
```powershell
|
||||
# Hot backup using SQLite backup API (safe while service is running)
|
||||
sqlite3 C:\ScadaLink\data\site.db ".backup C:\Backups\site-$(Get-Date -Format yyyyMMdd).db"
|
||||
sqlite3 C:\ScadaLink\data\store-and-forward.db ".backup C:\Backups\sf-$(Get-Date -Format yyyyMMdd).db"
|
||||
sqlite3 C:\ScadaBridge\data\site.db ".backup C:\Backups\site-$(Get-Date -Format yyyyMMdd).db"
|
||||
sqlite3 C:\ScadaBridge\data\store-and-forward.db ".backup C:\Backups\sf-$(Get-Date -Format yyyyMMdd).db"
|
||||
```
|
||||
|
||||
## Log Rotation
|
||||
|
||||
### Serilog File Sink
|
||||
|
||||
ScadaLink uses Serilog's rolling file sink with daily rotation:
|
||||
- New file created each day: `scadalink-20260316.log`
|
||||
ScadaBridge uses Serilog's rolling file sink with daily rotation:
|
||||
- New file created each day: `scadabridge-20260316.log`
|
||||
- Files are not automatically deleted.
|
||||
|
||||
### Log Retention Policy
|
||||
@@ -126,16 +126,16 @@ Implement a scheduled task to delete old log files:
|
||||
|
||||
```powershell
|
||||
# Delete log files older than 30 days
|
||||
Get-ChildItem C:\ScadaLink\logs\scadalink-*.log |
|
||||
Get-ChildItem C:\ScadaBridge\logs\scadabridge-*.log |
|
||||
Where-Object { $_.LastWriteTime -lt (Get-Date).AddDays(-30) } |
|
||||
Remove-Item -Force
|
||||
```
|
||||
|
||||
Schedule this as a Windows Task:
|
||||
```powershell
|
||||
$action = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-NoProfile -Command `"Get-ChildItem C:\ScadaLink\logs\scadalink-*.log | Where-Object { `$_.LastWriteTime -lt (Get-Date).AddDays(-30) } | Remove-Item -Force`""
|
||||
$action = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-NoProfile -Command `"Get-ChildItem C:\ScadaBridge\logs\scadabridge-*.log | Where-Object { `$_.LastWriteTime -lt (Get-Date).AddDays(-30) } | Remove-Item -Force`""
|
||||
$trigger = New-ScheduledTaskTrigger -Daily -At "03:00"
|
||||
Register-ScheduledTask -TaskName "ScadaLink-LogCleanup" -Action $action -Trigger $trigger -Description "Clean up ScadaLink log files older than 30 days"
|
||||
Register-ScheduledTask -TaskName "ScadaBridge-LogCleanup" -Action $action -Trigger $trigger -Description "Clean up ScadaBridge log files older than 30 days"
|
||||
```
|
||||
|
||||
### Log Disk Space
|
||||
@@ -164,13 +164,13 @@ If event log storage is consuming excessive disk space:
|
||||
|
||||
```powershell
|
||||
# Stop the service
|
||||
sc.exe stop ScadaLink-Site
|
||||
sc.exe stop ScadaBridge-Site
|
||||
|
||||
# Delete the event log database and let it be recreated
|
||||
Remove-Item C:\ScadaLink\data\event-log.db
|
||||
Remove-Item C:\ScadaBridge\data\event-log.db
|
||||
|
||||
# Restart the service
|
||||
sc.exe start ScadaLink-Site
|
||||
sc.exe start ScadaBridge-Site
|
||||
```
|
||||
|
||||
## Certificate Management
|
||||
@@ -180,7 +180,7 @@ sc.exe start ScadaLink-Site
|
||||
If using LDAPS (port 636), the LDAP server's TLS certificate must be trusted:
|
||||
1. Export the CA certificate from Active Directory.
|
||||
2. Import into the Windows certificate store on both central nodes.
|
||||
3. Restart the ScadaLink service.
|
||||
3. Restart the ScadaBridge service.
|
||||
|
||||
### OPC UA Certificates
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# ScadaLink Troubleshooting Guide
|
||||
# ScadaBridge Troubleshooting Guide
|
||||
|
||||
## Log Analysis
|
||||
|
||||
### Log Location
|
||||
|
||||
- **File logs:** `C:\ScadaLink\logs\scadalink-YYYYMMDD.log`
|
||||
- **File logs:** `C:\ScadaBridge\logs\scadabridge-YYYYMMDD.log`
|
||||
- **Console output:** Available when running interactively (not as a Windows Service)
|
||||
|
||||
### Log Format
|
||||
@@ -24,7 +24,7 @@ All log entries are enriched with:
|
||||
|
||||
| Pattern | Meaning |
|
||||
|---------|---------|
|
||||
| `Starting ScadaLink host as {Role}` | Node startup |
|
||||
| `Starting ScadaBridge host as {Role}` | Node startup |
|
||||
| `Member joined` | Cluster peer connected |
|
||||
| `Member removed` | Cluster peer departed |
|
||||
| `Singleton acquired` | This node became the active singleton holder |
|
||||
@@ -41,13 +41,13 @@ Use the structured log properties for targeted analysis:
|
||||
|
||||
```powershell
|
||||
# Find all errors for a specific site
|
||||
Select-String -Path "logs\scadalink-*.log" -Pattern "\[ERR\].*site-01"
|
||||
Select-String -Path "logs\scadabridge-*.log" -Pattern "\[ERR\].*site-01"
|
||||
|
||||
# Find S&F activity
|
||||
Select-String -Path "logs\scadalink-*.log" -Pattern "store-and-forward|buffered|parked"
|
||||
Select-String -Path "logs\scadabridge-*.log" -Pattern "store-and-forward|buffered|parked"
|
||||
|
||||
# Find failover events
|
||||
Select-String -Path "logs\scadalink-*.log" -Pattern "Singleton|Member joined|Member removed"
|
||||
Select-String -Path "logs\scadabridge-*.log" -Pattern "Singleton|Member joined|Member removed"
|
||||
```
|
||||
|
||||
## Common Issues
|
||||
@@ -60,7 +60,7 @@ Select-String -Path "logs\scadalink-*.log" -Pattern "Singleton|Member joined|Mem
|
||||
3. Health report interval has not elapsed since site startup.
|
||||
|
||||
**Diagnosis:**
|
||||
1. Check if the site service is running: `sc.exe query ScadaLink-Site`
|
||||
1. Check if the site service is running: `sc.exe query ScadaBridge-Site`
|
||||
2. Check site logs for errors.
|
||||
3. Verify network: `Test-NetConnection -ComputerName central-01.example.com -Port 8081`
|
||||
4. Wait 60 seconds (the offline detection threshold).
|
||||
|
||||
Reference in New Issue
Block a user