Tableau Server 2022.3 tsm 与 tabcmd 命令详解
详解 Tableau Server 2022.3 的 tsm 与 tabcmd 命令行:tsm 全部 157 条子命令分组速查、tabcmd 37 条命令与全局选项表,附常用命令实测输出。
Tableau Server 2022.3 tsm 与 tabcmd 命令详解
目标:完整梳理 Tableau Server 2022.3(内部版本 20223.24.0423.1447)自带的 tsm 与 tabcmd 两套命令行工具,给出 tsm 全部 157 条子命令的功能分组速查与 tabcmd 全部 37 条命令清单,并附常用命令的实测输出。全文命令与回显在 CentOS 8(x86_64)实测通过。
一、定位与运行方式
两套命令行分工明确,互不替代:
| 维度 | tsm | tabcmd |
|---|---|---|
| 定位 | 服务器管理(配置、拓扑、许可、维护) | 站点内容操作(用户、项目、工作簿、数据提取) |
| 服务对象 | 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 help | tsm 命令帮助 |
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/list | Prep Conductor Rserve SSL |
tsm security maestro-tabpy-ssl enable/disable/list | Prep 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/disable | JMX 启停 |
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-assertions | SAML |
tsm authentication sitesaml enable/disable | 站点级 SAML |
tsm authentication openid enable/disable/configure/map-claims/get-redirect-url | OpenID Connect |
tsm authentication kerberos enable/disable/configure | Kerberos |
tsm authentication sspi enable/disable | SSPI(仅 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/list | Web 数据连接器白名单 |
tsm data-access set-saml-delegation enable/disable/configure | SAP 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 即可恢复。
七、参考链接
- TSM 命令行参考:https://help.tableau.com/current/server-linux/en-us/tsm.htm
- tabcmd 命令行参考:https://help.tableau.com/current/server-linux/en-us/tabcmd_cmd.htm
- Tableau Server 管理员指南:https://help.tableau.com/current/server-linux/en-us/admin.htm
- Tableau 产品下载站:https://www.tableau.com/support/releases