netserva/fleet 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

netserva/fleet

Composer 安装命令:

composer require netserva/fleet

包简介

NetServa Fleet Management Plugin - VSite->VNode->VHost infrastructure tracking

README 文档

README

A comprehensive infrastructure management plugin for NetServa that tracks and manages your VSite→VNode→VHost hierarchy across mixed infrastructure environments.

Overview

NetServa Fleet provides unified management for:

  • VSites - Hosting providers/locations (local Incus, BinaryLane VPS, customer hardware)
  • VNodes - Physical/virtual servers
  • VHosts - VM/CT instances (complete virtualized environments, not just web vhosts)

Key Features

🏗️ Three-Tier Infrastructure Hierarchy

  • VSite (hosting provider/location) → VNode (server) → VHost (VM/CT instance)
  • Supports mixed infrastructure: local Incus, local Proxmox, BinaryLane VPS, customer hardware
  • Role-based node classification: compute, network, storage, mixed

🔍 SSH-Based Discovery

  • Automatic system information discovery via SSH
  • Graceful error handling for unreachable nodes
  • Role-specific discovery commands for different node types
  • Scheduled scanning with configurable frequency

📊 Comprehensive Management Interface

  • Full Filament 4.0 admin interface for fleet management
  • Real-time discovery status and system information
  • Bulk operations for discovery and management
  • Integration with existing NetServa SSH host management

📁 NetServa Integration

  • Import existing infrastructure from var/ directory structure
  • Sync with NetServa 54-variable environment files
  • Support for /srv/ filesystem layout standard
  • Integration with existing SSH host configurations

Installation

  1. Add to your Laravel application's composer.json:
"repositories": [
    {
        "type": "path",
        "url": "./packages/netserva-fleet"
    }
]
  1. Install the package:
composer require netserva/netserva-fleet
  1. Run migrations:
php artisan migrate
  1. Publish configuration (optional):
php artisan vendor:publish --tag=fleet-config

Usage

Import Existing Infrastructure

Import from your existing var/ directory structure:

# Dry run to see what would be imported
php artisan fleet:import --dry-run

# Import all infrastructure
php artisan fleet:import

# Import specific vnode only
php artisan fleet:import --vnode=mgo

# Force overwrite existing data
php artisan fleet:import --force

Discovery Management

Discover system information via SSH:

# Discover all nodes that need scanning
php artisan fleet:discover

# Discover specific vnode
php artisan fleet:discover --vnode=mgo

# Force discovery even if not scheduled
php artisan fleet:discover --force

# Test SSH connections only
php artisan fleet:discover --test-ssh

Web Interface

Access the fleet management interface at /admin/fleet-vsites in your Filament admin panel.

Configuration

VSite Directory Mappings

Configure how var/ directory names map to VSites in config/fleet.php:

'vsites' => [
    'directory_mappings' => [
        'mgo' => ['provider' => 'local', 'technology' => 'incus', 'location' => 'workstation'],
        'nsorg' => ['provider' => 'binarylane', 'technology' => 'vps', 'location' => 'sydney'],
    ],
],

Discovery Commands

Customize discovery commands for different node roles:

'discovery' => [
    'discovery_commands' => [
        'compute' => [
            'hostname -f',
            'uname -a',
            'cat /proc/cpuinfo | grep "processor" | wc -l',
            // ... more commands
        ],
        'network' => [
            'hostname',
            'uptime',
            'ip addr show',
        ],
    ],
],

Architecture

Database Schema

fleet_vsites (Hosting Providers)

  • Tracks hosting providers and technologies
  • Unique constraint on provider+technology+location
  • Capabilities and API endpoint configuration

fleet_vnodes (Servers)

  • Physical/virtual servers with SSH access
  • Role-based classification and discovery
  • System information and discovery status
  • Links to SSH host configurations

fleet_vhosts (VM/CT Instances)

  • Complete virtualized environments
  • NetServa environment variable integration
  • Instance type and resource tracking
  • File system integration with var/ directory

Discovery Architecture

  • Role-based discovery: Different commands for compute/network/storage nodes
  • Graceful failure handling: Continue discovery even if some commands fail
  • SSH-only approach: All discovery via SSH with proper error handling
  • Scheduled scanning: Configurable frequency with automatic retry for failures

Error Handling

  • SSH connection failures are logged but don't stop discovery
  • Command failures are tracked per-node for debugging
  • Partial discovery results are saved (get what we can)
  • Failed nodes are scheduled for retry at shorter intervals

Testing

Run the test suite:

# Run all fleet tests
php artisan test packages/netserva-fleet/tests

# Run specific test groups
php artisan test --group=fleet
php artisan test --group=discovery
php artisan test --group=import

NetServa Compliance

This plugin follows NetServa standards:

  • ✅ Uses NetServa 5-character environment variables ($NSVAR, $NSSSH, etc.)
  • ✅ Supports 54-variable NetServa environment files
  • ✅ Compatible with /srv/ filesystem layout
  • ✅ Integrates with existing SSH host management
  • ✅ Follows MIT license with consistent headers
  • ✅ Uses Pest 4.0 for testing
  • ✅ Filament 4.0 admin interface

License

MIT License - see LICENSE file for details.

Support

For issues and feature requests, please use the main NetServa repository issue tracker.

netserva/fleet 适用场景与选型建议

netserva/fleet 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 11 月 04 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「container」 「ssh」 「vm」 「infrastructure」 「fleet」 「netserva」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 netserva/fleet 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 netserva/fleet 我们能提供哪些服务?
定制开发 / 二次开发

基于 netserva/fleet 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 1
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 24
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-11-04