安装客户端

在你的机器上安装 Power Platform 客户端,接入分布式算力网络。

系统要求

操作系统架构最低版本
Linuxamd64 / arm64Kernel 4.15+
macOSamd64 / arm64macOS 11+
Windowsamd64Windows 10+

客户端体积小巧(约 16MB),无需额外运行时依赖,开箱即用。

安装方式

方式一:一键安装脚本(推荐)

在终端中执行以下命令,自动完成下载、安装和系统服务注册:

curl -sSL https://power.moyin.cloud/install.sh | sudo bash -s -- \
  --server power.moyin.cloud:9090 \
  --key <你的KEY>Shell

KEY 需要在 管理后台 申请。登录后台 → 密钥管理 → 创建新密钥。

方式二:手动下载

从 GitHub Releases 页面下载对应平台的二进制文件:

下载客户端

前往 GitHub Releases 下载最新版本

解压并赋予执行权限

解压后执行 chmod +x power-client

移动到系统路径(可选)

执行 sudo mv power-client /usr/local/bin/

各平台下载链接:

平台架构文件名
Linuxamd64power-client-linux-amd64.tar.gz
Linuxarm64power-client-linux-arm64.tar.gz
macOSamd64 (Intel)power-client-darwin-amd64.tar.gz
macOSarm64 (Apple Silicon)power-client-darwin-arm64.tar.gz
Windowsamd64power-client-windows-amd64.zip

方式三:从源码编译

需要 Go 1.23+ 环境:

git clone https://github.com/liufei379/power-platform.git
cd power-platform
go build -o bin/client ./client/cmdShell

验证安装

安装完成后,运行以下命令验证客户端是否正常工作:

./power-client --helpShell

你应该看到如下输出:

Usage of power-client:
  -config string    配置文件路径 (default "configs/config.yaml")
  -key string       认证 KEY
  -server string    服务端地址 (host:port)Output

启动客户端

使用以下三种方式之一启动:

命令行参数

./power-client \
  --server power.moyin.cloud:9090 \
  --key rc-xxxxxxxxxxxxShell

配置文件

创建 config.yaml 配置文件:

server:
  url: "power.moyin.cloud:9090"
  tls: true

key: "rc-xxxxxxxxxxxx"

client:
  version: "1.0.0"
  labels:
    env: "production"
    group: "default"

heartbeat:
  interval: 30config.yaml

然后启动:

./power-client --config config.yamlShell

环境变量

export PP_SERVER="power.moyin.cloud:9090"
export PP_KEY="rc-xxxxxxxxxxxx"
./power-clientShell

三种方式的优先级:命令行参数 > 环境变量 > 配置文件。建议生产环境使用配置文件方式。

连接成功

客户端启动后,如果看到以下日志,说明连接成功:

[agent] starting Power Platform client v1.0.0
[agent] hostname=my-server os=linux arch=amd64 ip=192.168.1.100
[connection] connected to power.moyin.cloud:9090
[connection] authenticated, clientID=abc-123-def
[connection] heartbeat stream established
[connection] command stream establishedOutput

此时你的机器已注册到平台,可在 管理后台 的「客户端管理」页面查看在线状态。

设为系统服务(可选)

使用 systemd 将客户端设为开机自启服务:

# 创建服务文件
sudo tee /etc/systemd/system/power-client.service << 'EOF'
[Unit]
Description=Power Platform Client
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/power-client --config /etc/power-client/config.yaml
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
EOF

# 创建配置目录并放入配置文件
sudo mkdir -p /etc/power-client
sudo cp config.yaml /etc/power-client/config.yaml

# 启用并启动
sudo systemctl daemon-reload
sudo systemctl enable power-client
sudo systemctl start power-clientShell

查看服务状态:

sudo systemctl status power-clientShell

客户端安装完成!接下来请阅读 配置说明 了解如何自定义客户端行为,或查看 首次连接 了解连接后的完整流程。