GenieACS功能与安装方法详解

GenieACS 是一个基于 TR-069 (CWMP) 协议 的开源自动配置服务器 (ACS),主要用于大规模远程管理和配置网络设备(如路由器、网关等)。

它基于 Node.jsMongoDB 构建,采用声明式配置引擎,支持管理数十万乃至数百万台设备。

📦 GenieACS 的核心功能模块

GenieACS 由四个独立的服务组件构成,共同完成设备管理任务:

组件名称 主要功能 默认端口
genieacs-cwmp 核心通信服务,处理设备与服务器间的TR-069协议交互。 7547
genieacs-nbi 北向接口 (NBI),提供RESTful API供外部系统集成。 7557
genieacs-fs 文件服务器,用于存储和分发固件、配置文件等。 7567
genieacs-ui Web管理界面,提供图形化操作界面。 3000

除了核心的设备配置、监控和固件升级,它还支持自动化任务调度设备分组管理扩展开发,功能非常全面。

🛠️ GenieACS 安装部署指南

以下是基于主流Linux系统(如Ubuntu/CentOS)的安装步骤。

第一步:安装环境依赖
首先确保系统中已安装Node.js和MongoDB。以下是在Ubuntu系统上的安装命令参考:

# 1. 安装 Node.js (推荐v14或以上)
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs

# 2. 安装 MongoDB
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org

# 3. 启动并设置MongoDB开机自启
sudo systemctl start mongod
sudo systemctl enable mongod

第二步:获取GenieACS源码并安装

# 克隆项目代码
git clone https://gitcode.com/gh_mirrors/ge/genieacs
cd genieacs

# 安装项目依赖
npm install

# 构建项目
npm run build

构建完成后,可执行文件会生成在 dist/bin/ 目录下。

第三步:启动GenieACS服务
建议按以下顺序启动四个服务(每个命令需要在独立的终端窗口或后台运行):

# 1. 启动核心通信服务 (CWMP)
./dist/bin/genieacs-cwmp

# 2. 启动北向接口 (NBI)
./dist/bin/genieacs-nbi

# 3. 启动文件服务器 (FS)
./dist/bin/genieacs-fs

# 4. 启动Web管理界面 (UI),需设置一个安全密钥
./dist/bin/genieacs-ui --ui-jwt-secret your_secure_secret_here

第四步:访问与初始化
服务启动后,打开浏览器访问 http://<你的服务器IP>:3000。首次访问时,系统会引导你完成创建管理员账户配置设备模板等初始化设置。

💡 配置建议与问题排查

  • 修改默认端口:可以通过环境变量修改服务端口,例如 GENIEACS_CWMP_PORT=7548 ./dist/bin/genieacs-cwmp
  • 生产环境安全:务必为 genieacs-ui 设置强壮的 --ui-jwt-secret;配置防火墙,只开放必要的端口(7547, 7567, 3000等)。
  • 服务无法启动:检查MongoDB服务是否运行(systemctl status mongod);检查端口是否被占用;通过设置 LOG_LEVEL=debug 查看详细日志。
  • 设备无法连接:确认设备配置的ACS URL地址和端口(默认7547)正确;检查服务器防火墙是否放行了相应端口。

请注意:以上信息主要整合自技术博客和社区教程,可作为快速入门参考。对于生产环境部署,强烈建议你查阅 GenieACS 官方文档 以获取最权威、最新的配置说明和安全建议。


评论

《 “GenieACS功能与安装方法详解” 》 有 2 条评论

  1. David唐辉 的头像
    David唐辉

    How to build your own TR069 ACS server
    https://www.youtube.com/watch?v=nH-bIBNEPBs

    1. Install node.js
    curl -sL https://deb.nodesource.com/setup_14.x -o nodesource_setup.sh
    sudo bash nodesource_setup.sh
    sudo apt install nodejs
    node -v
    2. Install MongoDB

    2.1 Install libssl1.1
    echo “deb http://security.ubuntu.com/ubuntu impish-security main” | sudo tee /etc/apt/sources.list.d/impish-security.list
    sudo apt-get update
    sudo apt-get install libssl1.1

    2.2 Install MongoDB
    curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add –
    apt-key list
    echo “deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse” | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
    sudo apt update
    sudo apt install mongodb-org
    sudo systemctl start mongod.service
    sudo systemctl status mongod
    sudo systemctl enable mongod
    mongo –eval ‘db.runCommand({ connectionStatus: 1 })’

    3. Install GenieACS
    http://docs.genieacs.com/en/latest/installation-guide.html#install-genieacs

回复 David唐辉 取消回复

您的邮箱地址不会被公开。 必填项已用 * 标注