Skip to content

Commit f645cca

Browse files
committed
Add Docker commands to collator.md monitoring and maintenance sections
1 parent 1859915 commit f645cca

File tree

1 file changed

+66
-24
lines changed

1 file changed

+66
-24
lines changed

node-infrastructure/run-a-collator/collator.md

Lines changed: 66 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -388,10 +388,20 @@ The registration process varies by system parachain. General steps include the f
388388

389389
Monitoring the following items will help ensure your collator runs efficiently to avoid service interruptions or down time:
390390

391-
- **Block Production**: monitor for block production using the following command:
392-
```bash
393-
sudo journalctl -u polkadot-collator | grep -i "prepared block"
394-
```
391+
- **Block Production**: Monitor for block production using the appropriate command for your setup:
392+
393+
=== "Docker Setup"
394+
395+
```bash
396+
docker logs polkadot-collator 2>&1 | grep -i "prepared block"
397+
```
398+
399+
=== "systemd Setup"
400+
401+
```bash
402+
sudo journalctl -u polkadot-collator | grep -i "prepared block"
403+
```
404+
395405
- **Peer Connections**: Maintain a sufficient amount of peers for good connectivity and set up alerts to notify if peer connections falls below ten.
396406
- **Resource Usage**: Monitor CPU, RAM, and disk I/O and set up alerts for unusual or high usage.
397407
- **Sync Status**: Ensure both chains stay synced and set up alerts for sync issues.
@@ -419,32 +429,64 @@ Key metrics to monitor via Prometheus include the following:
419429

420430
## Log Management
421431

422-
Effecient log management is essential to ensure collator performance and uptime. Use the following commands to help you manage logs to monitor and maintain your collator:
432+
Efficient log management is essential to ensure collator performance and uptime. Use the following commands to help you manage logs to monitor and maintain your collator:
433+
434+
=== "Docker Setup"
435+
436+
- View logs:
437+
```bash
438+
docker logs -f polkadot-collator
439+
```
440+
- View recent logs (last 100 lines):
441+
```bash
442+
docker logs --tail 100 polkadot-collator
443+
```
444+
- Filter for errors:
445+
```bash
446+
docker logs polkadot-collator 2>&1 | grep -i error
447+
```
448+
- Filter for block production:
449+
```bash
450+
docker logs polkadot-collator 2>&1 | grep -i "imported"
451+
```
452+
453+
=== "systemd Setup"
454+
455+
- View recent logs:
456+
```bash
457+
sudo journalctl -u polkadot-collator -n 100
458+
```
459+
- Follow logs in real-time:
460+
```bash
461+
sudo journalctl -u polkadot-collator -f
462+
```
463+
- Filter for errors:
464+
```bash
465+
sudo journalctl -u polkadot-collator | grep -i error
466+
```
467+
- Filter for block production:
468+
```bash
469+
sudo journalctl -u polkadot-collator | grep -i "imported"
470+
```
471+
472+
## Database Maintenance
473+
474+
Check database size periodically using the commands for your selected setup:
475+
476+
=== "Docker Setup"
423477

424-
- View recent logs:
425-
```bash
426-
sudo journalctl -u polkadot-collator -n 100
427-
```
428-
- Follow logs in real-time:
429-
```bash
430-
sudo journalctl -u polkadot-collator -f
431-
```
432-
- Filter for errors:
433478
```bash
434-
sudo journalctl -u polkadot-collator | grep -i error
479+
# Replace with your mounted data directory path
480+
du -sh ./collator-data
435481
```
436-
- Filter for block production:
482+
483+
=== "systemd Setup"
484+
437485
```bash
438-
sudo journalctl -u polkadot-collator | grep -i "imported"
486+
du -sh /var/lib/polkadot-collator
439487
```
440488

441-
## Database Maintenance
442-
443-
You can check database size using the following command:
444-
```bash
445-
du -sh /var/lib/polkadot-collator
446-
```
447-
The collator node handles pruning automatically.
489+
The collator node handles pruning automatically based on configuration.
448490

449491
## Updates and Upgrades
450492

0 commit comments

Comments
 (0)