Skip to content

Yêu cầu hệ thống

Thành phầnYêu cầu
QuyềnAdministrator/root để cài đặt service
MạngInternet (nếu dùng Registry)
Disk500MB free space
RAM1GB
PortsMQTT (1883), rsyslog (514), HTTP proxy (8080)

Theo nền tảng

Nền tảngOSArchitectureGhi chú
WindowsWindows 10/11 hoặc Server 2016+x64PowerShell 5.1+
LinuxUbuntu 18.04+, CentOS 7+, RHEL 7+, Debian 9+, Alpine 3.8+x86_64, ARM64systemd khuyến nghị

Cài đặt trên Windows

Bước 1: Tạo thư mục và copy binary

powershell
# Tạo thư mục
New-Item -ItemType Directory -Path "C:\Program Files\BlackHoleForwarder" -Force

# Copy binary
Copy-Item "blackhole-fwd.exe" -Destination "C:\Program Files\BlackHoleForwarder\blackhole-fwd.exe"

Bước 2: Cài đặt và khởi động service

powershell
cd "C:\Program Files\BlackHoleForwarder"

# Cài đặt service
.\blackhole-fwd.exe service install

# Khởi động service
.\blackhole-fwd.exe service start

Xác minh

powershell
# Kiểm tra trạng thái service
Get-Service -Name "blackhole-fwd"

# Xem logs
Get-EventLog -LogName Application -Source "blackhole-fwd" -Newest 10

Cài đặt trên Linux

Bước 1: Chuẩn bị

bash
# Tạo user và thư mục
sudo useradd -r -s /bin/false blackhole-forwarder
sudo mkdir -p /opt/blackhole-forwarder /etc/blackhole-forwarder /var/log/blackhole-forwarder

# Copy binary và set quyền
sudo cp blackhole-fwd-linux-x64 /opt/blackhole-forwarder/blackhole-fwd
sudo chmod +x /opt/blackhole-forwarder/blackhole-fwd

Bước 2: Cài đặt và khởi động service

bash
# Cài đặt service
sudo /opt/blackhole-forwarder/blackhole-fwd service install

# Khởi động service
sudo /opt/blackhole-forwarder/blackhole-fwd service start

Xác minh

bash
# Kiểm tra trạng thái
sudo /opt/blackhole-forwarder/blackhole-fwd service status

# Xem logs
sudo journalctl -u blackhole-fwd -f

Cấu hình ban đầu

Tạo cấu hình mẫu

bash
blackhole-fwd configure sample --path config.yml

Xác thực với Registry (tùy chọn)

bash
blackhole-fwd auth --key "your-api-key-here"

Gỡ cài đặt

Windows

powershell
.\blackhole-fwd.exe service stop
.\blackhole-fwd.exe service uninstall
Remove-Item -Recurse -Force "C:\Program Files\BlackHoleForwarder"

Linux

bash
sudo /opt/blackhole-forwarder/blackhole-fwd service stop
sudo /opt/blackhole-forwarder/blackhole-fwd service uninstall
sudo rm -rf /opt/blackhole-forwarder /etc/blackhole-forwarder /var/log/blackhole-forwarder
sudo userdel blackhole-forwarder

Khắc phục sự cố

Vấn đềNguyên nhânGiải pháp
Service không khởi độngThiếu quyền hoặc file không tồn tạiKiểm tra quyền và đường dẫn file
"Access Denied"Không có quyền administratorChạy PowerShell as Administrator
Binary không thực thiThiếu quyền executechmod +x /opt/blackhole-forwarder/blackhole-fwd
Permission deniedUser không có quyền truy cậpKiểm tra ownership và permissions

Released under the MIT License.