主要内容

本页采用了机器翻译。点击此处可查看最新英文版本。

prodserver.addon.install

从服务器安装 MATLAB Production Server 附加功能

    说明

    prodserver.addon.install(name,host,port) 从在 hostport 上运行的 MATLAB® Production Server™ 实例安装 MATLAB Production Server 附加功能 name

    您可以安装具有相同名称但托管在不同服务器上的多个附加功能。附加功能创建的代理函数出现在 MATLAB 搜索路径中。当您调用代理函数时,将调用最接近 MATLAB 搜索路径顶部的同名函数。有关 MATLAB 搜索路径的更多信息,请参阅 什么是 MATLAB 搜索路径? (MATLAB)

    此函数需要 MATLAB Client for MATLAB Production Server

    示例

    prodserver.addon.install(name,host,port,'TransportLayerSecurity',tf) 还允许您指定服务器的 URI 方案(HTTP 或 HTTPS)。

    示例

    prodserver.addon.install(name,endpoint) 让您指定可从中安装附加功能的活动服务器实例的网络地址。

    示例

    info = prodserver.addon.install(___) 还使用前面语法中的任何输入参量返回有关已安装附加功能的信息。

    示例

    示例

    全部折叠

    使用默认的 http 方案安装 MATLAB Production Server 附加功能。

    首先,在 MATLAB Production Server 实例上托管可部署存档 fractal。创建存档时,必须包含 MATLAB 函数签名文件。您必须在托管存档的服务器实例上启用发现服务。有关如何创建和部署存档的信息,请参阅针对 MATLAB Production Server 创建可部署存档将存档部署至 MATLAB Production Server

    从运行 IP 地址为 10.2.2.5 和端口 57142 的服务器安装 fractal 附加功能。

    prodserver.addon.install('fractal','10.2.2.5',57142)
    ans =
    
      1×5 table
    
                 Name         Version    Enabled                  Identifier                          Endpoint        
        __________________    _______    _______    ______________________________________    ________________________
    
        "fractal (R2020b)"    "1.0.0"     true      "599ce38c-eea1-4011-85b9-8d301b4d5375"    "http://10.2.2.5:57142"

    使用服务器的网络地址安装 MATLAB Production Server 附加功能。

    首先,在 MATLAB Production Server 实例上托管可部署存档 fractal。创建存档时,必须包含 MATLAB 函数签名文件。您必须在托管存档的服务器实例上启用发现服务。有关如何创建和部署存档的信息,请参阅针对 MATLAB Production Server 创建可部署存档将存档部署至 MATLAB Production Server

    从运行 IP 地址为 10.2.2.5 和端口 57142 的服务器安装 fractal 附加功能。

    prodserver.addon.install('fractal','http://10.2.2.5:57142')
    ans =
    
      1×5 table
    
                 Name         Version    Enabled                  Identifier                          Endpoint        
        __________________    _______    _______    ______________________________________    ________________________
    
        "fractal (R2020b)"    "1.0.0"     true      "599ce38c-eea1-4011-85b9-8d301b4d5375"    "http://10.2.2.5:57142"

    安装附加功能时使用 HTTPS 进行客户端与服务器通信。

    首先,在 MATLAB Production Server 实例上启用 HTTPS。有关详细信息,请参阅启用 HTTPS

    在服务器实例上托管可部署存档 fractal。创建存档时,必须包含 MATLAB 函数签名文件。您必须在托管存档的服务器实例上启用发现服务。有关如何创建和部署存档的信息,请参阅针对 MATLAB Production Server 创建可部署存档将存档部署至 MATLAB Production Server

    从运行 fractal 的服务器安装 https://10.2.2.5:57142 附加功能。

    prodserver.addon.install('fractal','10.2.2.5',57143,'TransportLayerSecurity',true)
    ans =
    
      1×5 table
    
                 Name         Version    Enabled                  Identifier                          Endpoint        
        __________________    _______    _______    ______________________________________    ________________________
    
        "fractal (R2020b)"    "1.0.0"     true      "599ce38c-eea1-4011-85b9-8d301b4d5375"    "https://10.2.2.5:57143"

    安装附加功能并获取有关已安装附加功能的信息。

    首先,在 MATLAB Production Server 实例上托管可部署存档 fractal。创建存档时,必须包含 MATLAB 函数签名文件。您必须在托管存档的服务器实例上启用发现服务。有关如何创建和部署存档的信息,请参阅针对 MATLAB Production Server 创建可部署存档将存档部署至 MATLAB Production Server

    从 IP 地址为 10.2.2.5 和端口 57142 的服务器安装 info 附加功能时,将信息保存到表 fractal 中。

    info = prodserver.addon.install('fractal','10.2.2.5',57142)
    info =
    
      1×5 table
    
                 Name         Version    Enabled                  Identifier                          Endpoint        
        __________________    _______    _______    ______________________________________    ________________________
    
        "fractal (R2020b)"    "1.0.0"     true      "599ce38c-eea1-4011-85b9-8d301b4d5375"    "http://10.2.2.5:57142"

    info 包含有关已安装的附加功能 fractal 的信息。

    输入参数

    全部折叠

    要从服务器安装的 MATLAB Production Server 附加功能的名称,指定为字符向量或字符串标量。

    示例: 'fractal'

    数据类型: char | string

    托管可部署存档的服务器(从中安装附加功能)的网络地址,指定为字符向量或字符串标量。网络地址的格式为 scheme://host_name_of_server:port_number

    示例: 'https://144.213.5.7:9920'

    数据类型: char | string

    托管可部署存档的服务器(从中安装附加功能)的主机名,指定为字符向量或字符串标量。

    示例: '144.213.5.7'

    数据类型: char | string

    托管可部署存档的服务器(从中安装附加功能)的端口号,指定为正标量。

    示例: 9920

    数据类型: uint8 | uint16

    设置附加功能与服务器通信时使用的 URI 方案的标志,指定为逻辑标量。如果不设置 tf 或者将 tf 设置为 false,则该函数将使用 http。如果将 tf 设置为 true,则该函数将使用 https

    示例: true

    数据类型: logical

    输出参量

    全部折叠

    有关已安装附加功能的信息,以表格形式返回。该表包含以下列:

    • Name - 已安装附加功能的名称

    • Version - 已安装附加功能的版本

    • Enabled - 布尔值,表示附加功能是否可用

    • Identifier - 唯一标识附加功能的字符串

    • Endpoint - 托管附加功能的服务器的网络地址,格式为 scheme://server_host_name:port_number

    版本历史记录

    在 R2019b 中推出