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)
Disk100MB free space
RAM512MB

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\BlackHoleAgent" -Force

# Copy binary
Copy-Item "blackhole-agt.exe" -Destination "C:\Program Files\BlackHoleAgent\blackhole-agt.exe"

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

powershell
cd "C:\Program Files\BlackHoleAgent"

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

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

Xác minh

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

# Xem logs
Get-EventLog -LogName Application -Source "blackhole-agt" -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-agent
sudo mkdir -p /opt/blackhole-agent /etc/blackhole-agent /var/log/blackhole-agent

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

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

bash
# Cài đặt service
sudo /opt/blackhole-agent/blackhole-agt service install

# Khởi động service
sudo /opt/blackhole-agent/blackhole-agt service start

Xác minh

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

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

Cấu hình ban đầu

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

bash
# Tạo cấu hình mẫu với tất cả sources/sinks
blackhole-agt configure sample --path config.yml

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

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

Gỡ cài đặt

Windows

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

Linux

bash
sudo /opt/blackhole-agent/blackhole-agt service stop
sudo /opt/blackhole-agent/blackhole-agt service uninstall
sudo rm -rf /opt/blackhole-agent /etc/blackhole-agent /var/log/blackhole-agent
sudo userdel blackhole-agent

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-agent/blackhole-agt
Permission deniedUser không có quyền truy cậpKiểm tra ownership và permissions

Released under the MIT License.