---
schema_version: "1"
id: 9fd69afb6defecca8bc135ff794c00fa207fef65f83a3494b290988f971a3a1a
title: Tableau Server 的自动安装
collection: tableau
version: next
locale: zh-cn
portal_url: https://docs.salesforce.com/tableau/next/zh-cn/server/automated_install_windows.md
canonical_url: https://help.tableau.com/v0.0/server/zh-cn/automated_install_windows.htm
source_site: help.tableau.com
content_type: documentation
content_hash: 8f1783702ba82a616b135c3fea212e5416859060c443939cc51ce075e0c45e79
description: Automate a new Tableau Server install on Windows using the community SilentInstaller.py script.
---
[跳转到主要内容](#main-content)

# Tableau Server 的自动安装

您可以使用[社区支持的](https://www.tableau.com/zh-cn/support-levels-it-and-developer-tools "在新窗口中打开") Python 脚本 `SilentInstaller.py` 来自动完成 Tableau Server 的新安装。您可以下载并按原样使用该脚本，或者针对自己的特定需求进行修改。

## 使用自动安装程序的好处

- 只需一个命令便可安装、配置和运行 Tableau Server 的工作实例。
- `SilentInstaller.py` 脚本可在没有用户输入的情况下运行，因此适合于自动化操作。
- 配置设置一次即可用于所有安装，使此过程变得可重复。

### 何时不使用自动安装程序

- 如果是第一次安装 Tableau Server，我们建议您在进行自动流程之前手动测试安装。阻止安装的任何问题都能通过交互方式更轻松地解决。解决这些问题之后，您可以使用 `SilentInstaller.py` 脚本执行 Tableau Server 的自动安装。
- 如果您在测试或尝试新的配置参数（例如身份验证方法），我们建议您先手动运行安装。Tableau 服务管理器 (TSM) 会验证配置实体，并拒绝无效的配置参数。确定了正确的参数之后，您就可以使用自动安装程序。
- 如果无法或不想在密文文件中输入密码，使用自动安装程序可能不适合于您。

## 开始之前

查看[安装之前...](https://help.tableau.com/v0.0/server/zh-cn/requ.htm)，确保您已在满足 Tableau Server 操作系统要求和最低硬件要求的计算机上安装了 Microsoft Windows Server。

**注意：**如果在生产环境中安装 Tableau Server，请查看最低硬件**推荐配置**。推荐配置表示您应为 Tableau Server 的生产安装使用的最低硬件配置。

为了执行自动安装，您可使用 `SilentInstaller.py` 脚本，该脚本依赖于 Tableau Server 安装程序包作为输入。在开始之前，我们建议您下载以下程序包：

1. 下载 [Python 3.5](https://www.python.org/downloads/windows/) 或更高版本，并将其安装在要在其中安装 Tableau Server 的计算机上。
2. 下载 `SilentInstaller.py` 脚本和 Tableau Server 安装程序包：
    
    1. 从 [GitHub](https://github.com/tableau/server-install-script-samples/tree/master/windows/tsm/SilentInstaller) 下载 `SilentInstaller.py` 脚本，以及 config.template.json、 registration.template.json、secrets.template.json 和三个引导程序模板（bootstrap.template.json、 topologyBootstrap.template.json 和 workerBootstrap.template.json）。
    2. 从 [Tableau Server 产品下载](https://www.tableau.com/zh-cn/support/releases/server/)页面选择并下载相应的 **Tableau Server 安装程序包**。您选择的安装程序包取决于要使用的 Microsoft Windows Server 版本。
3. 将程序包和模板复制到将在其中安装 Tableau Server 的计算机上的一个位置，或复制到可从该计算机访问的位置。

## 如何使用 SilentInstaller.py 脚本

`SilentInstaller.py` 脚本将安装 Tableau Server 安装程序包、创建目录、设置运行 Tableau Server 所需的权限，并启动 Tableau 服务管理器 (TSM) 安装程序。TSM 安装程序完成后，`SilentInstaller.py` 脚本将运行 `tsm` 命令来安装、配置和启动 Tableau Server。默认情况下，`SilentInstaller.py` 脚本将在安装过程中激活试用许可证。如果有实际产品密钥，您可以在命令行上提供该产品密钥，也可以在运行 `SilentInstaller.py` 脚本后激活产品密钥。自动安装程序中的大多数命令行选项与 [tsm initialize](https://help.tableau.com/v0.0/server/zh-cn/cli_initialize_tsm.htm) 命令使用的选项相同。

可在三种模式下运行 `SilentInstaller.py` 脚本：安装初始节点、安装附加节点，以及更新群集拓扑。为分布式群集执行安装时，您将使用用于在初始节点上安装初始节点的选项来运行 `SilentInstaller.py`。您将使用用于在每个附加节点上安装附加节点的选项来运行 `SilentInstaller.py`。最后，您将使用用于在初始节点上更新群集拓扑的选项来运行 `SilentInstaller.py`。

`SilentInstaller.py` 脚本的目的是无需用户交互即可运行，因此您必须将所有参数输入到传递至 `SilentInstaller.py` 脚本的所需自变量中。或者，您也可以将所需的自变量放在引导程序文件中。您可以使用提供的[配置、注册和密文文件模板](#Configur)。

使用以下步骤来执行无提示安装：

### 步骤 1：安装自动安装程序

1. 以具有管理员访问权限的用户身份登录到计算机。
2. 下载并安装 `SilentInstaller.py` 脚本、模板和引导程序文件。

### 步骤 2：创建文件以提供运行自动安装所需的其他配置信息

由于 `SilentInstaller.py` 脚本的目的是无需用户交互即可运行，因此您必须提供以下附加信息：

1. 将模板 **config.template.json**、**registration.template.json** 和 **secrets.template.json** 复制到另一个目录，比如您的主目录。我们不建议直接编辑模板文件。
2. 编辑 **config.template.json** 文件并提供初始节点配置设置。您必须为 Tableau Server 计算机提供身份存储设置。根据您的网络要求，您可能还需要提供网关设置。缓存选项设置为尽可能长时间缓存和重用数据。默认情况下安装了示例工作簿。模板包括了最少的所需信息，因此可以将模板作为一个出发点。有关配置设置的详细信息，请参见[配置初始节点设置](https://help.tableau.com/v0.0/server/zh-cn/config_general.htm)。
3. 编辑 **registration.template.json** 文件并提供注册 Tableau Server 所需的信息。有关详细信息，请参见[激活并注册 Tableau Server](https://help.tableau.com/v0.0/server/zh-cn/activate.htm)。
4. 编辑 **secrets.template.json** 文件并提供 TSM 管理员和 Tableau Server 管理员帐户的用户名和密码。
    
    - TSM 管理员帐户用户应是运行脚本的 Windows 管理员用户。
    - Tableau Server 管理员帐户是安装程序创建的初始帐户，用于管理 Tableau Server。

### 步骤 3：运行自动安装

1. 以具有管理员访问权限的用户身份登录到计算机。
    
    #### 安装初始节点
    
    `SilentInstaller.py` 脚本运行适当的命令来安装、激活许可证、配置以及启动 Tableau 服务管理器。运行 `SilentInstaller.py -h` 和 `SilentInstaller.py install –h` 可查看选项及其默认值的完整列表。
    
    **安装初始节点：**
    
    在初始节点上的 Python 提示符处，键入：
    
    `SilentInstaller.py install --secretsFile secrets.json --configFile myconfig.json --registrationFile registration.json TableauServer-64bit-<version>.exe`
    
    或者：
    
    `SilentInstaller.py --bootstrapFile <bootstrap file path>`
    
    <table class="simple-table"><colgroup><col style="width: 15%;"><col style="width: 85%;"><col><col></colgroup><thead><tr><td><p>脚本选项</p></td><td><p>描述</p></td></tr></thead><tbody><tr><td><strong>必需的开关</strong></td><td>&nbsp;</td></tr><tr><td><p>--configFile &lt;file path&gt;</p></td><td><p><a href="#ConfigFile">服务器配置</a> JSON 文件的相对或绝对路径。</p></td></tr><tr><td><p>--secretsFile &lt;file path&gt;</p></td><td><p><a href="#SecretsFile">密文文件</a>的相对或绝对路径，该文件描述用于向 Tableau 服务管理器 (TSM) 进行身份验证的 Windows 帐户的凭据，以及 Tableau Server 初始管理员用户的用户名/密码。密文文件还包括要用于激活 Tableau Server 的产品密钥。默认情况下，密文文件模板包含试用许可证。</p><p class="note"><b>注意：</b>在密文文件中提供密码是可选的。但是，如果在密文文件中找不到密码，系统将在安装期间提示您提供密码。</p><p>自动安装程序包包括密文文件的模板。</p></td></tr><tr><td><p>--registrationFile &lt;file path&gt;</p></td><td><p><a href="#RegFile">服务器注册</a>文件的相对或绝对路径，该文件包含 Tableau Server 注册信息。</p><p>自动安装程序包包括注册文件的模板。</p></td></tr><tr><td><p>&lt;installer executable file path&gt;</p></td><td><p>Tableau 服务管理器 (TSM) 安装程序的相对或绝对路径。</p></td></tr><tr><td><strong>可选开关</strong></td><td>&nbsp;</td></tr><tr><td><p>--installDir &lt;file path&gt;</p></td><td><p><span class="mc-variable Variables.ProductName variable">Tableau Server</span> 安装目录。如果不提供路径，则会使用默认目录 <b>C:\Program Files\Tableau\Tableau Server</b>。</p></td></tr><tr><td><p>--dataDir &lt;file path&gt;</p></td><td><p>Tableau Server 软件配置和数据的存储位置。如果不提供路径，则为配置和数据文件使用默认目录 <b>C:\ProgramData\Tableau</b>。</p></td></tr><tr><td><p>--installerLog &lt;file path&gt;</p></td><td><p>在其中写入安装程序日志文件的现有目录。如果您不提供路径，则会将日志文件写入 TEMP 目录。</p></td></tr><tr><td><p>--controllerPort &lt;port number&gt;</p></td><td><p>Tableau 服务管理器 (TSM) 控制器应在其上运行的端口。</p></td></tr><tr><td><p>--coordinationserviceClientPort &lt;port number&gt;</p></td><td><p>ZooKeeper 客户端端口。</p></td></tr><tr><td><p>--coordinationservicePeerPort &lt;port number&gt;</p></td><td><p>ZooKeeper 对等端口。</p></td></tr><tr><td><p>--coordinationserviceLeaderPort &lt;port number&gt;</p></td><td><p>ZooKeeper 负责人端口。</p></td></tr><tr><td><p>--start</p></td><td><p>服务器是否应在安装程序完成后启动。</p></td></tr></tbody></table>
    
    #### 安装附加节点
    
    `SilentInstaller.py` 脚本运行适当的命令在附加节点上安装 Tableau 服务管理器 (TSM)。运行 `SilentInstaller.py installWorker –h` 可查看选项及其默认值的完整列表。
    
    **安装附加节点：**
    
    在每个附加节点上的 Python 提示符处，键入：
    
    `SilentInstaller.py workerInstall --secretsFile secrets.json --nodeConfigurationFile nodeConfiguration.json TableauServer-64bit-<version>.exe`
    
    <table class="simple-table"><colgroup><col style="width: 15%;"><col style="width: 85%;"><col><col></colgroup><thead><tr><td><p>选项</p></td><td><p>描述</p></td></tr></thead><tbody><tr><td><p>--secretsFile &lt;file path&gt;</p></td><td><p>必需。<a href="#SecretsFile">密文文件</a>的相对或绝对路径，该文件描述用于向 Tableau 服务管理器 (TSM) 进行身份验证的 Windows 帐户的凭据，以及 Tableau Server 初始管理员用户的用户名/密码。密文文件还包括要用于激活 Tableau Server 的产品密钥。默认情况下，密文文件模板包含试用许可证。</p><p class="note"><b>注意：</b>在密文文件中提供密码是可选的。但是，如果在密文文件中找不到密码，系统将在安装期间提示您提供密码。</p><p>自动安装程序包包括密文文件的模板。</p></td></tr><tr><td><p>--nodeConfigurationFile &lt;file path&gt;</p></td><td><p>必需。用于安装附加节点的节点配置文件的路径。</p></td></tr><tr><td><p>(installer executable) &lt;file path&gt;</p></td><td><p>必需。脚本的最后一个参数只是 Tableau 服务管理器安装程序的绝对或相对路径，该安装程序通过常用渠道（例如从 Tableau 网站下载）获得。此脚本仅支持用于 Tableau 服务管理器。</p></td></tr><tr><td><p>--installDir &lt;file path&gt;</p></td><td><p>可选。<span class="mc-variable Variables.ProductName variable">Tableau Server</span> 安装目录。如果为空白，则会使用默认目录 <b>C:\Program Files\Tableau\Tableau Server</b>。</p></td></tr><tr><td><p>--dataDir &lt;file path&gt;</p></td><td><p>可选。Tableau Server 软件配置和数据的存储位置。如果为空白，则为配置和数据文件使用默认目录 <b>C:\ProgramData\Tableau</b>。</p></td></tr><tr><td><p>--installerLog &lt;file path&gt;</p></td><td><p>可选。在其中写入安装程序日志文件的现有目录。如果为空白，则会将日志文件写入用户的 TEMP 目录。</p></td></tr></tbody></table>
    
    **注意**：使用 `SilentInstaller.py` 安装第一个节点后，会自动保存节点配置文件。您可以在脚本的工作目录下找到该文件。
    
    #### 更新群集拓扑
    
    `SilentInstaller.py` 脚本运行适当的命令，根据需要为 Tableau 服务管理器 (TSM) 更新群集拓扑。运行 `SilentInstaller.py updateTopology –h` 可查看选项及其默认值的完整列表。
    
    更新群集拓扑：
    
    在初始节点上的 Python 提示符处，键入：
    
    `SilentInstaller.py updateTopology --secretsFile secrets.json --configFile myconfig.json`
    
    <table class="simple-table"><colgroup><col style="width: 15%;"><col style="width: 85%;"><col><col></colgroup><thead><tr><td><p>选项</p></td><td><p>描述</p></td></tr></thead><tbody><tr><td><p>--secretsFile &lt;file path&gt;</p></td><td><p>必需。<a href="#SecretsFile">密文文件</a>的相对或绝对路径，该文件描述用于向 Tableau 服务管理器 (TSM) 进行身份验证的 Windows 帐户的凭据，以及 Tableau Server 初始管理员用户的用户名/密码。密文文件还包括要用于激活 Tableau Server 的产品密钥。默认情况下，密文文件模板包含试用许可证。</p><p class="note"><b>注意：</b>在密文文件中提供密码是可选的。但是，如果在密文文件中找不到密码，系统将在安装期间提示您提供密码。</p><p>自动安装程序包包括密文文件的模板。</p></td></tr><tr><td><p>--configFile &lt;file path&gt;</p></td><td><p>必需。<a href="#ConfigFile">服务器拓扑</a>文件的相对或绝对路径，该文件描述要更新的 Tableau Server 拓扑。只会应用文件的 topologyVersion 部分，其他配置将被忽略。</p></td></tr></tbody></table>

## 配置、注册和密文文件模板

您可以使用以下示例模板向 `SilentInstaller.py` 脚本传递数据。

### 密文文件模板示例

{
    "local\_admin\_user":" ,
    "local\_admin\_pass":" ,
    "content\_admin\_user":" ,
    "content\_admin\_pass":" ,
    "product\_keys":\["trial"\]
}

local\_admin\_user 是用于向 Tableau 服务管理器进行身份验证的 Windows 帐户。

content\_admin\_user 是初始管理用户，该用户充当与创建和管理用户、站点等相关的所有 Tableau Server 操作的超级用户。

在安装附加节点或更新群集拓扑时，将会忽略这些凭据，因为安装初始节点时已经创建了初始管理员用户。

product\_keys 是用于激活 Tableau 服务管理器的密钥。如果指定了多个密钥，则会依次对密钥进行激活。对于非安装模式，将会忽略这些密钥，因为许可证已经激活。

### 服务器配置文件模板示例

```
{
"configEntities":{
    "runAsUser":{
        "_type":"runAsUserType",
        "name":"NT AUTHORITY\\NetworkService"
    },
    "gatewaySettings":{
        "_type":"gatewaySettingsType",
        "port":80,
        "firewallOpeningEnabled":true,
        "sslRedirectEnabled":true,
        "publicHost":"****replace me****",
        "publicPort":80,
        "sslEnabled":false,
        "sslPort":443
    },
    "identityStore":{
        "_type":"identityStoreType",
        "type":"local",
        "domain":"****Domain Name Here****",
        "nickname":"****Domain Nickname Here****"
    }
},
"topologyVersion":{
    "nodes":{
        "****insert nodeId (lowercase) here****": {
            "services": {
                "filestore": {
                    "instances":[
                        {
                        "instanceId":"0"
                        }
                    ]
                },
                "tabadmincontroller": {
                    "instances":[
                        {
                        "instanceId":"0"
                        }
                    ]
                },
                "clientfileservice": {
                    "instances":[
                        {
                        "instanceId":"0"
                        }
                    ]
                },
                "dataserver": {
                    "instances":[
                        {
                        "instanceId":"0"
                        },
                        {
                        "instanceId":"1"
                        }
                    ]
                },
                "cacheserver": {
                    "instances":[
                        {
                        "instanceId":"0"
                        },
                        {
                        "instanceId":"1"
                        }
                    ]
                },
                "vizqlserver": {
                    "instances":[
                        {
                        "instanceId":"0"
                        },
                        {
                        "instanceId":"1"
                        }
                    ]
                },
                "backgrounder": {
                    "instances":[
                        {
                        "instanceId":"0"
                        },
                        {
                        "instanceId":"1"
                        }
                    ]
                },
                "appzookeeper": {
                    "instances":[
                        {
                        "instanceId":"0"
                        }
                    ]
                },
                "pgsql": {
                    "instances":[
                        {
                        "instanceId":"0"
                        }
                    ]
                },
                "dataengine": {
                    "instances":[
                        {
                        "instanceId":"0"
                        }
                    ]
                },
                "licenseservice": {
                    "instances":[
                        {
                        "instanceId":"0"
                        }
                    ]
                },
                "searchserver": {
                    "instances":[
                        {
                        "instanceId":"0"
                        }
                    ]
                },
                "clustercontroller": {
                    "instances":[
                        {
                        "instanceId":"0"
                        }
                    ]
                },
                "tabsvc": {
                    "instances":[
                        {
                        "instanceId":"0"
                        }
                    ]
                },
                "vizportal": {
                    "instances":[
                        {
                        "instanceId":"0"
                        }
                    ]
                },
                "tabadminagent": {
                    "instances":[
                        {
                        "instanceId":"0"
                        }
                    ]
                },
                "clientfileservice": {
                    "instances":[
                        {
                        "instanceId":"0"
                        }
                    ]
                },
                "gateway": {
                    "instances":[
                        {
                        "instanceId":"0"
                        }
                    ]
                }
            }
        }
    }
}
}
			
```

### 服务器注册文件模板示例

```
{
    "first_name" : "Andrew",
    "last_name" : "Smith",
    "phone" : "311-555-2368",
    "email" : "andrew.smith@mycompany.com",
    "company" : "My Company",
    "industry" : "Finance",
    "company_employees" : "500",			
    "department" : "Engineering",
    "title" : "Senior Manager",
    "city" : "Kirkland",
    "state" : "WA",
    "zip" : "98034",
    "country" : "United States",
    "opt_in" : "true",
    "eula" : "true"
}
```