跳到主要内容

检查状态

blocklet server status 命令是监控 Blocklet Server 实例及其内部运行的所有 blocklet 健康状况的重要工具。它能快速、全面地提供整个系统的快照,从核心服务器进程到单个 blocklet 的状态。

用法

要在终端中检查状态,请运行以下命令。通常,该命令在 Blocklet Server 的数据目录中运行,但也可以从任何目录运行,因为它会定位正在运行的服务器进程。

blocklet server status

bash
blocklet server status

输出示例

典型的输出如下所示,提供了有关服务器和已安装 blocklet 的详细信息:

输出

bash
Blocklet Server status: Running (2 hours 15 minutes)
Blocklet Server mode: Production
Blocklet Server Data Directory: /home/user/.blocklet-server
Blocklet Server Router Engine: @blocklet/router-nginx
Blocklet Server Database: @blocklet/db-sqlite

Blocklets Status:
┌──────────────────────────────┬───────────────┬────────────────────────────────────────────────────────────────────┐
│ Name                         │ Status        │ URL                                                                │
├──────────────────────────────┼───────────────┼────────────────────────────────────────────────────────────────────┤
│ My Awesome App               │ running       │ https://z2qa7g7b1f6d8e...did.abtnet.io                              │
├──────────────────────────────┼───────────────┼────────────────────────────────────────────────────────────────────┤
│ Data Analytics Tool          │ stopped       │ https://z8t9b3c2d1e0f...did.abtnet.io                              │
├──────────────────────────────┼───────────────┼────────────────────────────────────────────────────────────────────┤
│ Internal Dashboard           │ errored       │ https://z5m4n3o2p1q0r...did.abtnet.io                              │
└──────────────────────────────┴───────────────┴────────────────────────────────────────────────────────────────────┘

You can access your blocklet server with either of the following URLs:
- http://192.168.1.100
- http://localhost

理解输出

服务器信息

此部分概述了核心服务器进程:

  • Blocklet Server status:显示服务器守护进程的当前状态。常见的状态包括 RunningStoppedStartingStoppingErrored。如果正在运行,它还会显示正常运行时间。
  • Blocklet Server mode:指示服务器是在 Production 还是 Development 模式下运行。
  • Blocklet Server Data Directory:服务器数据目录的绝对路径,其中存储了配置、blocklet 和数据。
  • Router Engine & Database:显示当前配置的路由(例如,nginx)和数据库(例如,sqlite)提供程序。

Blocklets 状态

此表列出了服务器上安装的所有 blocklet:

  • Name:blocklet 的人类可读标题,在其 blocklet.yml 中定义。
  • Status:单个 blocklet 的当前运行时状态(例如,runningstoppederrored)。
  • URL:用于访问 blocklet Web 界面的唯一的、去中心化的 URL。

访问 URL

当服务器运行时,此部分提供本地网络和/或 localhost URL,以便在您的 Web 浏览器中访问 Blocklet Server 的主仪表盘。

选项

  • --force-intranet boolean — 默认情况下,该命令可能会显示可用的公共 URL。使用此标志可确保“访问 URL”部分仅显示本地网络(内网)IP 地址。当您在本地网络上并希望确保直接连接时,这很有用。
bash
blocklet server status --force-intranet

特殊情况

  • 如果服务器未启动,该命令将只输出: bash Blocklet Server is not started
  • 如果未安装任何 blocklet,您将看到一条警告消息而不是表格: bash No blocklets installed yet.

检查状态后,您可能需要检查服务器日志以获取更详细的信息或管理服务器状态。