@extends('layouts.admin') @section('title', '命令速查表') @section('content')

命令速查表

系统维护
启动全部 supervistorctl start all
启动 Web 节点 supervistorctl start lae-web 或者 art octane:start
启动 队列 supervistorctl start lae-queue
启动 计划任务 supervistorctl start lae-schedule
停止全部 supervistorctl stop all
停止 Web 节点 supervistorctl stop lae-web 或者 art octane:stop
停止 队列 supervistorctl stop lae-queue
停止 计划任务 supervistorctl stop lae-schedule
重启全部 supervistorctl restart all
重启 Web 节点 supervistorctl restart lae-web 或者 art octane:restart *重载art octane:reload
重启 队列 supervistorctl restart lae-queue
重启 计划任务 supervistorctl restart lae-schedule
启动维护模式 art down
关闭维护模式 art up

*如果是大更新,需要启动维护模式。

首先,拉取最新代码 sudo -u www git pull
然后,安装依赖 composer install --no-dev
接着,升级数据库(只需要在一台节点上执行) art migrate
最后,清除缓存 art optimize
如果是非 Web 节点,需要重启全部或者对应服务,比如 队列,计划任务 supervisorctl restart all
如果是 Web 节点,需要简单重启即可 supervisorctl restart lae-web
用户相关
应用程序
要为外部程序服务,你需要先创建一个应用程序。
应用程序的登录验证方式是 Bearer + Token。
MQTT

创建认证

在这之前,我们推荐你创建一个 Password-Based 的认证,选 Built-in Database ,账号类型选择 username。

创建一个 HTTP Server 的数据源,请求方式为 POST。

URL 填 {{ route('applications.mqtt.authentication') }}
Header 中增加一个 Authorization,值为 Bearer + 应用程序的密钥。注意空格。
认证中的 Body 填写:
{
  "client_id": "${clientid}",
  "password": "${password}",
  "username": "${username}"
}
        

如果 EMQX 启用了 TLS,则你需要勾选 "TLS 配置" 下面的 "启用 TLS",并且关闭 "验证服务器证书"。

之后,保存即可。接着,将你添加的认证设置放在 Built-in Database 下面。

创建授权

此操作将判断客户端是否有指定的权限。

在这之前,我们推荐你创建一个 Built-in Database 的授权,之后关闭 File 授权。

创建一个 Password-Based 的认证,服务选择 HTTP Server,请求方式为 POST。

URL 填 {{ route('applications.mqtt.authorization') }}
Header 中增加一个 Authorization,值为 Bearer + 应用程序的密钥。注意空格。
认证中的 Body 填写:
{
  "action": "${action}",
  "client_id": "${clientid}",
  "topic": "${topic}",
  "username": "${username}"
}
        

如果 EMQX 启用了 TLS,则你需要勾选 "TLS 配置" 下面的 "启用 TLS",并且关闭 "验证服务器证书"。

之后,保存即可。接着,将你添加的认证设置放在 Built-in Database 之前(确保 Built-in Database 在 HTTP Server 下面)。

接下来,在授权页面,点击右上角的“设置”,将“未匹配时执行”调整为“deny”,再配置大概 5 分钟左右的缓存。然后保存。

@endsection