Tableau Server 2022.3 tsm 与 tabcmd 命令详解

详解 Tableau Server 2022.3 的 tsm 与 tabcmd 命令行:tsm 全部 157 条子命令分组速查、tabcmd 37 条命令与全局选项表,附常用命令实测输出。

TableauTableauBI2026/10/13

Tableau Server 2022.3 tsm 与 tabcmd 命令详解

目标:完整梳理 Tableau Server 2022.3(内部版本 20223.24.0423.1447)自带的 tsm 与 tabcmd 两套命令行工具,给出 tsm 全部 157 条子命令的功能分组速查与 tabcmd 全部 37 条命令清单,并附常用命令的实测输出。全文命令与回显在 CentOS 8(x86_64)实测通过。

一、定位与运行方式

两套命令行分工明确,互不替代:

维度tsmtabcmd
定位服务器管理(配置、拓扑、许可、维护)站点内容操作(用户、项目、工作簿、数据提取)
服务对象TSM 管理面(8850 端口)Tableau Server 应用面(网关 80 端口)
命令数量157 条子命令37 条子命令
使用前提initialize-tsm 完成即可用需先 --accepteula;登录需服务器运行中
典型场景启停服务、改配置、加节点、备份建站、批量建用户、发布/下载工作簿、刷新提取

1.1 二进制位置与环境加载

tsm 与 tabcmd 均通过 initialize-tsm 写入的 PATH 直接调用:

  • tsm 实际路径:/opt/tableau/tableau_server/packages/customer-bin.20223.24.0423.1447/tsm
  • tabcmd 实际路径:/opt/tableau/tabcmd/bin/tabcmd
  • 环境脚本:/etc/profile.d/tableau_server.sh(新 shell 自动加载;当前会话手工 source 一次)
which tsm tabcmd
/opt/tableau/tableau_server/packages/customer-bin.20223.24.0423.1447/tsm
/opt/tableau/tabcmd/bin/tabcmd

1.2 tsm 登录与 tabcmd EULA

tsm 每次会话先登录(或依赖已保存的凭据):

tsm login -u tabadmin -p q1w2e3r4

tabcmd 首次运行任何命令必须先接受 EULA,否则一律拒绝执行:

You must accept the End User License Agreement (EULA) using --accepteula. Canceling.
You can find the EULA in /opt/tableau/tabcmd

--accepteula 只需首条命令携带一次即可。

二、tsm 命令详解(157 条分组速查)

以下按功能域分组列出全部子命令,说明取自 tsm help 实测输出。

2.1 服务器生命周期与状态

命令说明
tsm initialize初始化 Tableau Server(前置:注册 + 身份存储)
tsm start启动 Tableau Server
tsm stop停止 Tableau Server
tsm restart重启 Tableau Server
tsm status查看服务器状态(-v 显示各服务明细)
tsm version显示 TSM 与服务器版本
tsm helptsm 命令帮助

2.2 登录、注册与重置

命令说明
tsm login登录 TSM(默认 8850)
tsm logout退出 TSM 登录
tsm register产品注册(--template 生成模板,--file 提交)
tsm reset清除初始管理员,配合 tabcmd initialuser 重建

2.3 配置、设置与待应用变更

命令说明
tsm configuration get读取当前生效配置值
tsm configuration set写入配置(进入 pending 状态)
tsm configuration list-dynamic-keys列出支持平滑生效的动态键
tsm pending-changes list列出待应用变更
tsm pending-changes apply应用待应用变更
tsm pending-changes discard丢弃待应用变更
tsm settings export导出活动配置与拓扑
tsm settings import导入配置与拓扑设置
tsm settings clone克隆配置、机密与拓扑到指定目录
tsm customize自定义服务器名称、Logo 等

2.4 许可管理

命令说明
tsm licenses activate激活许可(-t 试用 / -k <KEY> 产品密钥 / -f <TLF> 离线文件)
tsm licenses deactivate停用许可(在线/离线)
tsm licenses list查看已激活许可
tsm licenses refresh刷新全部产品密钥的维护期
tsm licenses get-offline-activation-file生成离线激活文件
tsm licenses get-offline-deactivation-file生成离线停用文件
tsm licenses atr-configuration get读取 ATR 配置(需 --duration 参数形态)
tsm licenses atr-configuration set设置 ATR(授权运行时)时长

2.5 拓扑管理

命令说明
tsm topology list-nodes列出节点及其服务(-v 详情)
tsm topology list-ports列出集群全部端口
tsm topology set-process设置节点上某服务的进程数
tsm topology set-ports设置服务实例端口
tsm topology set-node-role设置 Backgrounder/Data Engine 节点角色
tsm topology remove-nodes从集群移除节点
tsm topology nodes get-bootstrap-file获取新增节点引导文件
tsm topology failover-repository触发仓库主备切换
tsm topology filestore decommission文件存储节点下线准备(转只读)
tsm topology filestore recommission恢复下线状态的文件存储节点
tsm topology deploy-coordination-service部署协调服务(ZooKeeper 集合)
tsm topology cleanup-coordination-service清理非生产协调服务集合
tsm topology toggle-coordination-service在新旧协调服务集合间切换
tsm topology external-services gateway enable启用独立网关
tsm topology external-services gateway disable停用独立网关
tsm topology external-services gateway update更新独立网关
tsm topology external-services list列出外部服务
tsm topology external-services repository enable启用外部 PostgreSQL 仓库
tsm topology external-services repository disable停用外部仓库
tsm topology external-services repository replace-host重新指向新的外部仓库
tsm topology external-services storage enable启用外部存储(网络共享)
tsm topology external-services storage disable停用外部存储
tsm topology external-services storage switch-share切换外部存储共享路径

2.6 安全管理

命令说明
tsm security external-ssl enable/disable/list外部 SSL(网关 HTTPS)启停与查看
tsm security repository-ssl enable/disable/list内部仓库 SSL 启停与查看
tsm security repository-ssl get-certificate-file获取仓库公钥证书
tsm security custom-cert add/delete/list自定义证书(如邮件服务器信任)导入/删除/列出
tsm security kms set-mode local/aws/azure密钥管理模式切换
tsm security kms status查看 KMS 状态
tsm security regenerate-internal-tokens重新生成内部令牌
tsm security rotate-coordination-service-secrets轮换协调服务密钥与证书
tsm security maestro-rserve-ssl enable/disable/listPrep Conductor Rserve SSL
tsm security maestro-tabpy-ssl enable/disable/listPrep Conductor TabPy SSL
tsm security vizql-extsvc-ssl enable/disable/list分析扩展 SSL(历史命令)
tsm security cancel-credential-migrations取消站点间嵌入凭据迁移授权

2.7 维护与备份

命令说明
tsm maintenance backup创建服务器数据备份(.tsbak)
tsm maintenance restore从 .tsbak 恢复
tsm maintenance ziplogs打包日志归档
tsm maintenance cleanup清理旧文件与过期表项
tsm maintenance send-logs上传日志到 Tableau 支持工单
tsm maintenance reindex-search重建搜索索引
tsm maintenance reset-searchserver重置搜索服务器并重建索引
tsm maintenance validate-resources校验站点工作簿与数据源
tsm maintenance validate-backup-basefilepath校验备份目录权限
tsm maintenance preflight-check permissions预检安装/数据目录权限
tsm maintenance preflight-check ports预检服务端口占用
tsm maintenance jmx enable/disableJMX 启停
tsm maintenance metadata-services enable/disable元数据服务启停(重建 API Store)
tsm maintenance metadata-services get-status元数据服务状态
tsm maintenance snapshot-backup prepare/complete/restore快照备份三段式(需 Advanced Management)

2.8 认证方式与身份存储

authentication 组(认证方式开关与配置):

命令说明
tsm authentication list列出各认证方式启用状态
tsm authentication mutual-ssl enable/disable/configure双向 SSL
tsm authentication saml enable/disable/configure/export-metadata/map-assertionsSAML
tsm authentication sitesaml enable/disable站点级 SAML
tsm authentication openid enable/disable/configure/map-claims/get-redirect-urlOpenID Connect
tsm authentication kerberos enable/disable/configureKerberos
tsm authentication sspi enable/disableSSPI(仅 Windows)
tsm authentication trusted configure受信任票据认证
tsm authentication pat-impersonation enable/disable管理员 PAT 身份代理
tsm authentication legacy-identity-mode enable/disable旧版身份表模式
tsm authentication identity-migration configure身份迁移配置

user-identity-store 组(身份存储连接与映射):

命令说明
tsm user-identity-store list查看身份存储类型(实测 local)
tsm user-identity-store set-connection设置连接参数(AD/LDAP)
tsm user-identity-store set-user-mappings设置用户属性映射
tsm user-identity-store set-group-mappings设置组属性映射
tsm user-identity-store get-user-mappings查看用户属性映射
tsm user-identity-store get-group-mappings查看组属性映射
tsm user-identity-store verify-user-mappings按用户验证映射
tsm user-identity-store verify-group-mappings按组验证映射

💡 本地身份存储的设置不走 set-* 子命令,而是 tsm settings import 导入 identityStore 实体,见《Tableau Server 2022.3 tsm 配置参数详解》5.1。

2.9 作业与调度

命令说明
tsm jobs list列出异步作业(初始化/部署/备份等)
tsm jobs cancel取消排队中的作业
tsm jobs reconnect重新接入作业进度输出
tsm schedules list列出提取刷新等调度
tsm schedules delete删除调度
tsm schedules suspend暂停调度
tsm schedules resume恢复调度
tsm schedules update更新调度

2.10 数据访问、站点与邮件

命令说明
tsm data-access caching list/set数据访问缓存策略
tsm data-access repository-access enable/disable/list仓库直连访问(readonly 用户)
tsm data-access web-data-connectors add/allow/delete/listWeb 数据连接器白名单
tsm data-access set-saml-delegation enable/disable/configureSAP HANA SAML 委派
tsm sites export导出站点
tsm sites import导入站点
tsm sites import-verified从校验通过的导出目录导入站点
tsm sites unlock解锁站点
tsm email test-smtp-connection测试 SMTP 连通性

三、tsm 常用命令实测

3.1 version 与 status

tsm version
Tableau Services Manager command line version 20223.24.0423.1447.
Tableau Server version 20223.24.0423.1447.

服务器运行中查看全部服务明细(-v 逐服务展示,DEGRADED 状态下可直接定位 Error 服务):

tsm status -v
node1: localhost
        Status: RUNNING
        'Tableau Server Gateway 0' is running.
        'Tableau Server Application Server 0' is running.
        'Tableau Server Interactive Microservice Container 0' is running.
                'MessageBus Microservice 0' is running.
                'Relationship Query Microservice 0' is running.
                'Credentials Service 0' is running.
        'Tableau Server VizQL Server 0' is running.
        'Tableau Server Cache Server 0' is running.
        'Tableau Server Coordination Service 0' is running.
        'Tableau Server Cluster Controller 0' is running.
        'Tableau Server Search And Browse 0' is running.
        'Tableau Server Backgrounder 0' is running.
        'Tableau Server Non-Interactive Microservice Container 0' is running.
        'Tableau Server Data Server 0' is running.
        'Tableau Server Data Engine 0' is running.
        'Tableau Server File Store 0' is running.
        'Tableau Server Repository 0' is running (Active Repository).
        'Tableau Server Index And Search Server 0' is running.
        'Tableau Server Ask Data 0' is running.
        'Tableau Server Administration Agent 0' is running.
        'Tableau Server Administration Controller 0' is running.
        'Tableau Server License Manager 0' is running.
        'Tableau Server Activation Service 0' is running.
        'Tableau Server Client File Service 0' is running.
        'Tableau Server Database Maintenance 0' is stopped.
        'Tableau Server Backup/Restore 0' is stopped.
        'Tableau Server Site Import/Export 0' is stopped.
        'Tableau Server SAML Service 0' is stopped.
        'Tableau Server Collections Service 0' is running.
        'Tableau Server Content Exploration Service 0' is running.
        'Tableau Server Webhooks 0' is running.
        'Tableau Server Authentication 0' is running.
        'Tableau Server API Gateway 0' is running.
        'Tableau Server Analytics Extensions Microservice 0' is running.
        'Tableau Server Messaging Service 0' is running.
        'Tableau Server Data Source Properties Service 0' is running.
        'Tableau Server Internal Data Source Properties Service 0' is running.
        'Tableau Server Virtual Connections Service 0' is running.
        'Tableau Server Metrics Service 0' is running.
        'Tableau Server Query Gateway Service 0' is running.
        'Tableau Server Query Policy Service 0' is running.
        'Tableau Server Tableau Minerva Service 0' is running.
        'Tableau Server Extract Service 0' is running.
        'Tableau Server Data Profiling Service 0' is running.
        'Tableau Server Resource Limits Manager 0' is running.
        'Tableau Server Tableau Statistical Service 0' is running.

💡 Database Maintenance、Backup/Restore、Site Import/Export、SAML Service 四个服务 stopped 属正常——按需启停,仅在备份/恢复/站点导入导出时运行。

3.2 login 与 jobs list

tsm login -u tabadmin -p q1w2e3r4
tsm jobs list
ID: 0
        Type: DeploymentsJob
        Status message: This job completed successfully.
        Created at: 10/12/26, 3:47 PM
        Completed at: 10/12/26, 3:48 PM
ID: 1
        Type: InitializeServerJob
        Status message: This job is currently running.
        Created at: 10/12/26, 3:48 PM

3.3 licenses 激活与查看

tsm licenses activate -t
Trial activated.
tsm licenses list
Number of product keys: 1
KEY                       TYPE         CREATOR      EXPLORER     VIEWER       DATA MANAGEMENT           GUEST ACCESS LIC EXP      MAINT EXP    UPDATABLE    LBLM         ADVANCED MANAGEMENT
trial                     Term         25           0            0            true                      false        10/26/26     6/13/25      false        false        true

3.4 topology list-nodes 与 list-ports

tsm topology list-nodes -v
Node ID              Node Role            Address              Processes
node1                all-jobs             localhost            Activation Service : 1
                                                               Administration Agent : 1
                                                               Administration Controller : 1
                                                               Client File Service : 1
                                                               Coordination Service : 1
                                                               License Manager : 1
tsm topology list-ports

输出节选(node1 的部分服务端口):

node1
        filestore:primary: 8196
        authnservice:primary: 8541
        interactive:primary: 8024
        tabadmincontroller:primary: 8850
        backgrounder:primary: 8981
        extractservice:primary: 8093
        floweditor:primary: 8076
        cacheserver: 8414
        dataserver:primary: 8384

3.5 authentication list

tsm authentication list
Authentication Types
--------------------
Username and Password for non-admin users Enabled: true
MutualSSL Enabled: false
SAML Enabled: false
Kerberos Enabled: false
OpenID Enabled: false
PAT Impersonation Enabled: false

四、tabcmd 命令详解

4.1 命令全表(37 条)

命令说明
tabcmd login登录服务器(会话凭据默认保存复用)
tabcmd logout退出登录
tabcmd version显示 tabcmd 版本
tabcmd help帮助(help <命令>、help commands)
tabcmd initialuser在未初始化服务器上创建初始管理员
tabcmd createusers在服务器(默认站点)批量创建用户
tabcmd createsiteusers在指定站点批量创建用户
tabcmd addusers向组添加用户
tabcmd removeusers从组移除用户
tabcmd creategroup创建本地组
tabcmd deletegroup删除组
tabcmd syncgroup与 AD 组同步
tabcmd createproject创建项目
tabcmd deleteproject删除项目
tabcmd createsite创建站点
tabcmd editsite编辑站点
tabcmd deletesite删除站点
tabcmd listsites列出用户可见站点
tabcmd listdomains列出域
tabcmd editdomain编辑域(重命名/设置昵称)
tabcmd publish发布工作簿/数据源/提取到服务器
tabcmd delete删除服务器上的工作簿或数据源
tabcmd get从服务器下载文件
tabcmd export导出视图的数据或图片
tabcmd refreshextracts刷新工作簿/数据源的提取
tabcmd createextracts为已发布工作簿/数据源创建提取
tabcmd deleteextracts删除已发布工作簿/数据源的提取
tabcmd encryptextracts加密站点全部提取
tabcmd decryptextracts解密站点全部提取
tabcmd reencryptextracts重加密站点全部提取
tabcmd runschedule立即执行指定调度
tabcmd set设置服务器配置项
tabcmd reset_openid_sub重置用户 OpenID SubId
tabcmd upgradethumbnails重渲染 2018.2 前旧缩略图(负载高,可 --stop 终止)
tabcmd validateidpmetadata校验站点 IdP 的 SHA-1/弱密钥风险

4.2 全局选项表

所有命令通用的全局选项(实测 tabcmd help commands 输出):

选项说明
-s,--server <URL>服务器地址(无协议前缀默认 http://)
-u,--username <USER>用户名
-p,--password <PASSWORD>密码
--password-file <FILE>从文件读密码
-t,--site <SITEID>目标站点 ID("" 强制默认站点)
--[no-]cookie是否保存会话 ID(默认保存)
-c,--use-certificate客户端证书登录
--no-certcheck跳过 SSL 证书校验(自签名环境必加)
--no-prompt不交互询问密码
--no-proxy不使用 HTTP 代理
-x,--proxy <HOST:PORT>指定 HTTP 代理
--timeout <SECONDS>命令等待服务器完成的最长秒数
-h,--help帮助

五、tabcmd 常用命令实测

5.1 version

tabcmd --accepteula version
Tableau Server Command Line Utility -- 20223.24.0423.1447

5.2 initialuser 创建初始管理员

tsm initialize -r 完成后服务器没有管理员账户,第一个管理员用 initialuser 创建:

tabcmd initialuser --server http://localhost -u admin -p q1w2e3r4
===== redirecting to http://localhost/auth
===== Signed out
===== Creating new session
=====     Server:   http://localhost
=====     Username: admin
===== Connecting to the server...
===== Signing in...
===== Succeeded

⚠️ 未创建初始管理员时执行 login 会报 Invalid username or password. (errorCode=16);此时执行 tsm reset 也会以 TApplicationException 失败(reset 仅用于重建已有初始管理员的场景)。

5.3 login / listsites / logout

tabcmd login -s http://localhost -u admin -p q1w2e3r4
===== redirecting to http://localhost/auth
===== Signed out
===== Creating new session
=====     Server:   http://localhost
=====     Username: admin
===== Connecting to the server...
===== Signing in...
===== Succeeded

登录凭据默认保存为会话(--no-cookie 可关闭),后续命令免登录:

tabcmd listsites
===== Continuing previous session
=====     Server:   http://localhost
=====     Username: admin
===== Listing sites for user admin...
=====

NAME: Default
SITEID: '""'
tabcmd logout
===== redirecting to http://localhost/auth
===== Signed out

六、常见问题

6.1 tabcmd 报 You must accept the End User License Agreement

tabcmd 任何命令执行前都必须先接受 EULA:

You must accept the End User License Agreement (EULA) using --accepteula. Canceling.

在首条命令加 --accepteula 即可,如 tabcmd --accepteula version。

6.2 tsm 连接失败:Connection refused / 无法访问 8850

TSM 管理面固定监听 8850(HTTPS)。确认 TSM 管理服务(tabadmincontroller)在运行:ss -lntp | grep 8850。防火墙放行:

firewall-cmd --permanent --add-port=8850/tcp
firewall-cmd --reload

6.3 tabcmd login 提示证书校验失败

服务器使用自签名证书时,tabcmd login 需加 --no-certcheck;或 login 用 http:// 协议连接本机网关(经防火墙确认 80 端口连通)。

6.4 tsm initialize 一直处于 running 怎么看进度

tsm initialize 是异步 Job,CLI 断开后用 tsm jobs reconnect(或 tsm jobs list)重新接入最新作业的实时进度,不必重新执行初始化。

6.5 tsm status 显示 DEGRADED 是否必须处理

DEGRADED 表示存在 Error 服务但整体可用。逐服务看 tsm status -v 定位 Error 项,结合 /var/opt/tableau/tableau_server/data/tabsvc/logs/ 下对应服务日志排查;若发生在初始化后,内存不足导致的应用服务 Error 扩容后 tsm restart 即可恢复。

七、参考链接

  1. TSM 命令行参考:https://help.tableau.com/current/server-linux/en-us/tsm.htm
  2. tabcmd 命令行参考:https://help.tableau.com/current/server-linux/en-us/tabcmd_cmd.htm
  3. Tableau Server 管理员指南:https://help.tableau.com/current/server-linux/en-us/admin.htm
  4. Tableau 产品下载站:https://www.tableau.com/support/releases