跳至正文

【实战】CentOS安装Tableau Server 2019.2(更新2021.4)

Apr 26, 2023 Update

之前在RH上安装过Tableau Server,近期一家新客户安装了CentOS,借此整理如下。过程比Tableau官方的说明要复杂一些,本文在介绍过程同时重点列明官方help文件中没有阐述的“隐形知识”或者前提(对于非it而言),希望帮助没有深度Linux背景的朋友,希望能够自学解决问题。

环境说明:

  • CentOS 7.6
  • Tableau Server 2019.2
  • 我的本机:MacBook Pro

关注几个问题:

  • 如何解决“TSM初始化脚本”的用户和权限问题?
  • 如何通过命令快速激活、注册。
  • 如何使用命令远程下载驱动程序到远程服务器,然后安装? NEW

一、安装之前准备工作

1、关于用户的关键说明

近日与厂家工程师沟通,对方建议“尽量不要自行创建缺省的tableau用户,改用admin或者其他用户名称”,可以避免潜在的风险。同时,为了保证新建的普通用户具有一定的管理员权限,把它加入wheel群组。之后所有的步骤全部使用这个账户执行,而非root账户。

这样的设置也会保证系统的安全。

//最新:建议创建非tableau名称的用户,并添加到wheel组,然后并设置密码。
//此处代码由Tableau原厂工程师 Simon提供,感谢。
[root@localhost scripts.20192.19.0518.0639]# useradd admin
[root@localhost scripts.20192.19.0518.0639]# usermod -aG wheel admin
[root@localhost scripts.20192.19.0518.0639]# passwd admin
更改用户 admin 的密码 。
新的 密码:
重新输入新的 密码:
passwd:所有的身份验证令牌已经成功更新。

可以查看指定组下的成员,方便后续对比

[root@centos72new1 ~]# groupmems -g wheel -l
centos admin
[root@centos72new1 ~]#

在正式安装之前,特别推荐切换到admin账号,需要root权限时使用sudo,非常不推荐直接用root安装。

[root@centos72new1 admin]# su admin
[admin@centos72new1 ~]$ pwd
/home/admin
[admin@centos72new1 ~]$

[admin@centos72new1 ~]$ yum upgrade
  Loaded plugins: fastestmirror
  You need to be root to perform this command.
[admin@centos72new1 ~]$ sudo yum upgrade
Loaded plugins: fastestmirror
…………

2、关于更新系统

推荐在安装之前,upgrade更新系统,离线环境建议挂载iso镜像包,否则后续安装会提示很多依赖包缺少。

我在给客户安装时,有时会遇到很难解决的问题,其中一个解决办法就是upgrade,比如早年出现过一个错误(systemd-run: invalid option — ‘q’ ),想尽各种办法未能查到原因,最后先update整个系统(伴随漫长的等待),然后即可。

我这里就在离线环境中,配置了ISO文件(参考其他网站说明),如下:

[admin@centos72new1 ~]$ sudo yum upgrade
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package NetworkManager.x86_64 1:1.0.6-27.el7 will be obsoleted
---> Package NetworkManager.x86_64 1:1.18.8-1.el7 will be obsoleting
---> Package NetworkManager-libnm.x86_6
(……………………此处省略数百行)
ystemd-libs                   i686                      219-78.el7                                          centos7                    424 k
 xz-libs                      i686                      5.2.2-1.el7                                         centos7                    109 k
 zlib                        i686                      1.2.7-18.el7                                        centos7                     91 k

Transaction Summary
=======================================================================================================================================================================
Install   11 Packages (+63 Dependent packages)
Upgrade  288 Packages

Total download size: 332 M
Is this ok [y/d/N]: y
Downloading packages:
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                   58 MB/s | 332 MB  00:00:05
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : libgcc-4.8.5-44.el7.x86_64                                                                                                                        1/657
  Updating   : centos-release-7-9.2009.0.el7.centos.x86_64                                                                                                      2/657
  Installing : 1:grub2-c
(……………………此处省略数百行)

更新通常很快完成。

3、远程连接linux

感谢@唐安毅指点,我才知道macOS中自带了远程终端命令,超级方便,这里必须贴个图说明一下。

Linux 安装 00.jpg

之后点击连接,即可打开终端,开始Linux的旅行,我找了几个命令,查看一下Linux和系统状态(假装自己是Linux行家 😄)

root@60.216.46.76's password: //此处输入密码
Last failed login: Wed Jul3 07:37:47 CST 2019 from 134.209.179.213 on ssh:notty

[root@localhost ~]# uname -a //显示Linux版本 

Linux localhost.localdomain 3.10.0-123.el7.x86_64 #1 SMP Mon Jun 30 12:09:22 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

[root@localhost ~]# lsb_release -a // 显示软件版本

LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.6.1810 (Core)
Release: 7.6.1810
Codename: Core

二、安装的主要步骤

Tableau Server安装分为几大步:

  • 安装软件
  • 安装TSM脚本(Tableau Service Manager可以理解为管理工具)、
  • 激活并注册软件(用许可证密钥激活软件、用企业最终用户信息注册软件)
  • 配置软件(最主要是本地存储策略)、初始化TSM、创建管理账户。
  • 测试发布,确认无误后,安装驱动程序。

在这个过程中,最关键而容易出错的是首次初始化TSM脚本命令(initialize-tsm ),几乎必然会遇到问题,这里官方有些地方不够完整(针对业务人员),我后面重点说一下;其次是配置完整后的初始化TSM (tsm initialize ),这里是事故高发时段,只能通过关注日志文件来处理。

1、安装server软件包

之后通过cd命令(我记得是change directory的首字母)切换到保存Tableau Server的目录。

[root@localhost ~]# cd /20190626_hou  //切换到保存安装文件的目录 20190626_hou
[root@localhost 20190626_hou]# ls //列举查看包含的文件
tableau-server-2019-2-0.x86_64.rpm

接下来使用Linux的安装命令,安装server文件,这里最容易出现的问题是缺失依赖包,好在在线环境会自动下载,这也是我建议客户从Windows迁移为Linux的重要原因——闭源的Windows需要手动下载VC,netFramework等各种插件,还会遇到插件版本不兼容需要卸载重装的情况。

正常情况下,使用yum install安装命令,一次就会顺利完成,包含自动下载依赖包,结果如下(注意此处的中文是系统显示的部分,与客户安装系统时选择中文模式有关:

[root@localhost 20190626_hou]# yum install tableau-server-2019-2-0.x86_64.rpm
已加载插件:fastestmirror, langpacks
正在检查 tableau-server-2019-2-0.x86_64.rpm: tableau-server-20192.19.0518.0639-20192-19.0518.0639.x86_64
tableau-server-2019-2-0.x86_64.rpm 将被安装
正在解决依赖关系
--> 正在检查事务
---> 软件包 tableau-server-20192.19.0518.0639.x86_64.0.20192-19.0518.0639 将被 安装
--> 正在处理依赖关系 fuse,它被软件包 tableau-server-20192.19.0518.0639-20192-19.0518.0639.x86_64 需要
base | 3.6 kB 00:00
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
(1/4): extras/7/x86_64/primary_db | 205 kB 00:00
(2/4): base/7/x86_64/group_gz | 166 kB 00:00
(3/4): updates/7/x86_64/primary_db | 6.5 MB 00:01
(4/4): base/7/x86_64/primary_db | 6.0 MB 00:01
Determining fastest mirrors
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
--> 正在处理依赖关系 chrpath,它被软件包 tableau-server-20192.19.0518.0639-20192-19.0518.0639.x86_64 需要
--> 正在处理依赖关系 freeglut,它被软件包 tableau-server-20192.19.0518.0639-20192-19.0518.0639.x86_64 需要
--> 正在处理依赖关系 redhat-lsb-core,它被软件包 tableau-server-20192.19.0518.0639-20192-19.0518.0639.x86_64 需要
--> 正在检查事务
---> 软件包 chrpath.x86_64.0.0.16-0.el7 将被 安装
---> 软件包 freeglut.x86_64.0.3.0.0-8.el7 将被 安装
---> 软件包 fuse.x86_64.0.2.9.2-11.el7 将被 安装
---> 软件包 redhat-lsb-core.x86_64.0.4.1-27.el7.centos.1 将被 安装
--> 正在处理依赖关系 redhat-lsb-submod-security(x86-64) = 4.1-27.el7.centos.1,它被软件包 redhat-lsb-core-4.1-27.el7.centos.1.x86_64 需要
--> 正在处理依赖关系 spax,它被软件包 redhat-lsb-core-4.1-27.el7.centos.1.x86_64 需要
--> 正在检查事务
---> 软件包 redhat-lsb-submod-security.x86_64.0.4.1-27.el7.centos.1 将被 安装
---> 软件包 spax.x86_64.0.1.5.2-13.el7 将被 安装
--> 解决依赖关系完成
依赖关系解决
==================================================================
Package 架构 版本 源 大小
==================================================================
正在安装:
tableau-server-20192.19.0518.0639 x86_64 20192-19.0518.0639 /tableau-server-2019-2-0.x86_64
3.2 G
为依赖而安装:
chrpath x86_64 0.16-0.el7 base 26 k
freeglut x86_64 3.0.0-8.el7 base 185 k
fuse x86_64 2.9.2-11.el7 base 86 k
redhat-lsb-core x86_64 4.1-27.el7.centos.1 base 38 k
redhat-lsb-submod-security x86_64 4.1-27.el7.centos.1 base 15 k
spax x86_64 1.5.2-13.el7 base 260 k

事务概要
====================================================================
安装 1 软件包 (+6 依赖软件包)

总计:3.2 G
总下载量:609 k
安装大小:3.2 G
Is this ok [y/d/N]: y  //输入y继续安装
Downloading packages:
警告:/var/cache/yum/x86_64/7/base/packages/chrpath-0.16-0.el7.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID f4a80eb5: NOKEY
chrpath-0.16-0.el7.x86_64.rpm 的公钥尚未安装
(1/6): chrpath-0.16-0.el7.x86_64.rpm | 26 kB 00:00
(2/6): redhat-lsb-core-4.1-27.el7.centos.1.x86_64.rpm | 38 kB 00:00
(3/6): fuse-2.9.2-11.el7.x86_64.rpm | 86 kB 00:00
(4/6): freeglut-3.0.0-8.el7.x86_64.rpm | 185 kB 00:00
(5/6): spax-1.5.2-13.el7.x86_64.rpm | 260 kB 00:07
(6/6): redhat-lsb-submod-security-4.1-27.el7.centos.1.x86_ | 15 kB 00:07
--------------------------------------------------------------------------------
总计 80 kB/s | 609 kB 00:07
从 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 检索密钥
导入 GPG key 0xF4A80EB5:
用户ID : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
指纹 : 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
软件包 : centos-release-7-0.1406.el7.centos.2.3.x86_64 (@anaconda)
来自 : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
是否继续?[y/N]:y  //输入y继续安装
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : freeglut-3.0.0-8.el7.x86_64 1/7
正在安装 : spax-1.5.2-13.el7.x86_64 2/7
正在安装 : fuse-2.9.2-11.el7.x86_64 3/7
正在安装 : redhat-lsb-submod-security-4.1-27.el7.centos.1.x86_64 4/7
正在安装 : redhat-lsb-core-4.1-27.el7.centos.1.x86_64 5/7
正在安装 : chrpath-0.16-0.el7.x86_64 6/7

Your hardware meets the minimum requirements for a trial of Tableau Server.
If you plan to run Tableau Server in a production environment, we recommend the following hardware specifications: http://www.tableau.com/products/server/specs
Tableau Server runs best with at least 32 GB memory, but found only 31 GB of memory.
Tableau Server runs best with at least 8 cores, but found only 6 core(s).

正在安装 : tableau-server-20192.19.0518.0639-20192-19.0518.0639.x86_64 7/7

If this is a single node or initial node installation, run:
sudo /opt/tableau/tableau_server/packages/scripts.20192.19.0518.0639/initialize-tsm --accepteula

to continue setting up Tableau Server. If this installation is part of a multi-node configuration,
see the online documentation for installing Tableau Server on additional nodes.

验证中 : chrpath-0.16-0.el7.x86_64 1/7
验证中 : redhat-lsb-submod-security-4.1-27.el7.centos.1.x86_64 2/7
验证中 : fuse-2.9.2-11.el7.x86_64 3/7
验证中 : spax-1.5.2-13.el7.x86_64 4/7
验证中 : tableau-server-20192.19.0518.0639-20192-19.0518.0639.x86_64 5/7
验证中 : redhat-lsb-core-4.1-27.el7.centos.1.x86_64 6/7
验证中 : freeglut-3.0.0-8.el7.x86_64 7/7

已安装:
tableau-server-20192.19.0518.0639.x86_64 0:20192-19.0518.0639

作为依赖被安装:
chrpath.x86_64 0:0.16-0.el7 freeglut.x86_64 0:3.0.0-8.el7 fuse.x86_64 0:2.9.2-11.el7 redhat-lsb-core.x86_64 0:4.1-27.el7.centos.1
redhat-lsb-submod-security.x86_64 0:4.1-27.el7.centos.1 spax.x86_64 0:1.5.2-13.el7


中间会有两次输入 -y,之后就会顺利安装完毕!

2、初始化tsm脚本

安装完成之后,初始化tsm脚本,和后面使用tsm命令初始化不同,因此建议大家用“初始化tsm脚本”和“tsm初始化”分开

初始化TSM主要是两步:切换到文件目标、执行命令行。

[admin@localhost 20190626_hou]$ cd /opt/tableau/tableau_server/packages/scripts.20192.19.0518.0639 //切换到scripts.脚本目

推荐进入script*路径,然后专注于initialize-tsm的部分,必备的参数是–accepteula(同意软件许可),其他都是可选项。

【补充】2021年开始,Tableau推出了ATR激活策略,这个需要联网方可使用。如果不能联网,需要增加 –no-activation-service的附加命令,比如如下所示:

sudo /opt/tableau/tableau_server/packages/scripts.20212.22.1108.1355/initialize-tsm --accepteula --no-activation-service --debug

如果服务器联网,默认开启ATR策略,那么只需要最简单的初始化脚本命令,如下所示:

[admin@localhost scripts.20192.19.0518.0639]$ sudo ./initialize-tsm --accepteula
//执行“初始化tsm”脚本(initialize-tsm)
Creating directories and setting permissions...
Using '/var/opt/tableau/tableau_server' as the data directory.
Adding user 'tableau' to group 'tableau'... //系统自动把用户tableau加入群组tableau
Adding user 'tableau' to group 'tsmadmin'... //把用户tableau加入群组tsmadmin
Added. Note: These group membership changes do not take effect in shells already open. For these to take effect, log out of the shell and log back in.
//提醒:上述更改在其他已经打开的shell中无效,退出终端重新登录即可。
Tableau Server runs best with at least 50 GB of free disk space,
but found only 38 GB for the data directory '/var/opt/tableau/tableau_server'.
//硬盘空间不足提醒

如果可用磁盘低于15G,或者低于4核心、32G RAM等最低硬件要求,系统都会直接中止;如果高于最低要求,但是不满足推荐要求,那么系统也会提醒,但可以正常安装。

特别注意的是,随着Tableau Server逐渐增加AI相关的功能,2022年版本开始,Tableau Server对服务器硬件的要求逐渐提高。推荐对AI没有要求的用户使用2021.4版本(目前稳定性更高)。

Continuing. //继续初始化
Creating environment file... //创建环境文件
Starting TSM services... //启动tsm服务
正在更新 Tableau Server 协调服务中的存储库版本。
TSM services started successfully //TSM服务成功启动
Use the 'tsm' command to continue setting up Tableau Server. //使用tsm命令继续配置server(注册和激活、配置存储策略等)
>> Tableau binary directory will be added to PATH for new shells. To get the
>> updated path, either start a new session, or for bash users run:
>> source /etc/profile.d/tableau_server.sh
// 环境变量已经添加
The TSM administrative web interface (and REST API) is now available at
https://localhost.localdomain:8850
You can continue the configuration and initialization of Tableau server using either the TSM command line interface,
or the web interface.
// TSM管理接口已经可用(8850端口),可以继续使用终端命令配置,或者使用web接口配置

You will be prompted to authenticate, or can log in using the username 'tableau', with the same password you used to log into this session. You could also use any username, with its password, from the administrative group in the domain.
//系统将提示验证,或者继续使用(配置的用户)登陆。也可以使用同一个域中管理组的其他成员登陆。
Done.

这个环节,最容易遇到的问题多半和账户有关,比如无法创建tableau或者tsmadmin两个内置账号,无法添加到合适的组,使用root账号安装导致后期无法打开8850等。

大部分情况下,我们会遇到下面的故障,我结合我的命令说明,更容易理解:

以默认的root账户执行上面的脚本命令导致错误 ,建议切换到admin后用sudo执行。 错误如下:
[root@
localhost scripts.20192.19.0518.0639]# sudo ./initialize-tsm --accepteula
User 'root' has been selected as the user to add to the TSM authorized group, but
TSM does not allow root as a TSM-authorized user. You must either re-run this
script using 'sudo' while logged in as a normal user instead of root (most common
case), rerun this script with the '-a username' option to select a user other than
root to add to the group, or the '-g' flag to disable group addition completely
and add appropriate users to the group yourself. Canceling.

另一个选择是最后添加 -a 指定用户,这里可以指定admin,但不要使用tableau作为管理账号。

[root@localhost scripts.20192.19.0518.0639]# sudo ./initialize-tsm --accepteula -a admin
User 'admin' does not exist, unable to add to groups. Canceling.

//如果提示admin用户不存在,无法添加到群组,最好是提前创建好。

这里推荐的方法是:

  • 自行添加一个非root用户,特别是新系统,我此前是为客户创建一个tableau用户(本案中后面见到的’tableau’即非root用户),不过建议大家不要使用tableau这个缺省账户,改用admin或者其他名称。
  • su切换为非root用户,再执行脚本命令。

还有一类错误时提示权限错误,问题出在新建的普通用户没有在tsmadmin这个管理组中(这个组会被自动创建),此时可以使用命令手动把tableau添加到tsm管理组。

sudo usermod -G tsmadmin -a tableau

随着Tableau Server越来越庞大(复杂),初始化也会有很多可用的命令,常见的有-a 指定管理用户、-d指定自定义路径、-debug提示安装异常、–[no-]activation-service是否启用ATR等。

[admin@agileweb scripts.20214.23.0315.2055]$ sudo ./initialize-tsm  -h
  Usage: initialize-tsm --accepteula [optional arguments]

  Sets up directories and permissions to properly run the Tableau Services Manager,
  and then starts TSM.

  When no options are given, the script uses default values.

  REQUIRED
    --accepteula                            Indicate that you have accepted the End User License Agreement (EULA).
                                            You can find the EULA in
                                            /opt/tableau/tableau_server/packages/docs.20214.23.0315.2055

  REQUIRED WHEN ADDING A WORKER NODE
    -b <bootstrap-file>                     Location of the bootstrap file downloaded from the Tableau Services Manager
                                            on existing node. Must be provided to join existing Tableau Server cluster. Bootstrap
                                            files by default contain a temporary embedded credential. The credential will be used
                                            to automatically authenticate to the controller node. The credential will not be used
                                            if a username (-u) or password file (--password-file) is provided when calling this script.

  OPTIONAL WHEN ADDING A WORKER NODE
    -u <username>                           Name of the user with admin privileges on existing Tableau Services Manager.
                                            Required if -b option specified and no embedded credential is found.
                                            For more information look at the description of the -b option.

    --password-file=<value>                 A file containing the TSM admin password. Only required if -u is specified.

  OPTIONAL
    -c <config-name>                        Set the service configuration name.
                                            If not set, the default is "tabsvc".

    -d <data-directory>                     Set a custom location for the data directory
                                            if it's not already set. If not set, the default is
                                            "/var/opt/tableau/tableau_server".

    -f                                      Bypass warning messages or distribution version check

    -g                                      Do NOT add the current user to the "tsmadmin" administrative
                                            group, used for default access to Tableau Services Manager, or
                                            to the "tableau" group, used for easier access to log files.

    -a <username>                           The provided username will be used as the user to be added
                                            to the appropriate groups, instead of the user running this
                                            script. Providing both -a and -g is not allowed.

    -q                                      Quiet, suppress output except for errors and warnings.

    -i <coordinationservice-client-port>    Client port for the coordination service
    -e <coordinationservice-peer-port>      Peer port for the coordination service
    -m <coordinationservice-leader-port>    Leader port for the coordination service
    -t <licenseservice-vendordaemon-port>   Vendor daemon port for the licensing service
    -n <agent-filetransfer-port>            Filetransfer port for the agent service

    -o <controller-port>                    Https port for the controller service

    -l <port-range-min>                     Lower port bound for automatic selection

    -r <port-range-max>                     Upper port bound for automatic selection

    --disable-port-remapping                Disable automatic port selection

    --unprivileged-user=<value>             Name of the unprivileged account to run Tableau Server.
                                            Default: "tableau".

    --tsm-authorized-group=<value>          Name of the group(s) that allows authorization to access Tableau Services Manager.
                                            Default: "tsmadmin".

    --disable-account-creation              Do not create groups or the user account for Server and TSM authorization.
                                            However, the values in: unprivileged-username and tsm-authorized-groupname
                                            will still be used in TSM configuration.

    --http_proxy=<value>                    Http forward proxy for Tableau Server. Its value should be http://<proxy_address>:<proxy_port>/
                                            For example, --http_proxy=http://1.2.3.4:3128/ or --http_proxy=http://example.com:3128/

    --https_proxy=<value>                   Https forward proxy for Tableau Server. Its value should be http://<proxy_address>:<proxy_port>/
                                            For example, --https_proxy=http://1.2.3.4:3128/ or --https_proxy=http://example.com:3128/
                                            Take care to use http when you specify the URL for the https_proxy environmental variable.
                                            Do not specify the https protocol for the value of the https_proxy environmental variable.

    --no_proxy=<value>                      Environment variable that directs certain URLs to bypass the forward proxy. For example,
                                            --no_proxy=localhost,127.0.0.1,localaddress,.localdomain.com

    --[no-]activation-service               Specify whether the Tableau authorization-to-run (ATR) service should be used to activate Tableau Server.
                                            This option is ideal for cloud-based or virtual environments, but is available to anyone who can acticate
                                            their copy of Tableau Server online. Selecting ATR for product activation is a permanent choice that cannot
                                            be undone later. If no option is specified, the Tableau authorization-to-run (ATR) service will be used to
                                            activate Tableau Server.

 

3、初始化之后,退出sheel重新登陆

最简单的方式是exit 。

“ 再次登录时,将会创建一个组成员身份变更已生效的新会话。新会话也具有 initialize-tsm 脚本所添加环境变量的访问权限。“ 或者,您可以运行以下命令来更新当前会话的路径(但不更新组成员身份):

“source /etc/profile.d/tableau_server.sh

Tableau Manual

这里之所以需要exit或者logout当前账户,是为了更新会话变量,也可以直接更新路径(不推荐)。

 

三、设置与配置阶段

这里,UI图形界面和命令方式二选一即可,推荐在图形界面(web)中实现。

1,激活、注册、初始化(图形界面方法)

理论上,一旦正常完成了上面的操作,后面的操作都可以使用图形界面来完成,这也是最方便的方式。当然,这里需要确保IP和端口可以被访问。

如果在本地,使用localhost:8850,如果是远程,则使用IP:8850访问。按照如下步骤完成:

  • 此处我已经激活过了,因此跳过了激活过程,激活过程下次补充。
  • 注册:填写公司的使用信息。
install 1
  • 设置:主要是选择身份存储类型,这里不可逆,务必谨慎。
install 2
  • 初始化:这里最容易出现问题,出问题后根据提示查询log发给工程师或者IT排查。
install 3
  • 完成之后提示初始化完成,即可创建管理员。
install 4

2,激活、注册、初始化(命令方法)

如果因为特殊原因,需要使用命令来完成,且有网络的情况下,激活和注册操作如下:

[root@localhost ~]# tsm status
Status: STOPPED
[root@localhost ~]# tsm licenses activate -t  //激活试用版本
//激活正式的许可证,使用 tsm licenses activate -k <product key>

已激活试用版。
[root@localhost ~]# ls
anaconda-ks.cfg 公共 视频 文档 音乐
initial-setup-ks.cfg 模板 图片 下载 桌面
[root@localhost ~]# mkdir tab
[root@localhost ~]# cd tab
[root@localhost tab]# tsm register –template > registration_file.json //创建注册模版
[root@localhost tab]# ls
registration_file.json
[root@localhost tab]# vi registration_file.json //使用vi编辑注册模版
[root@localhost tab]# vi registration_file.json //重新打开,确认编辑无误
[root@localhost tab]# tsm register –file registration_file.json //导入注册模版
注册完成。

这里使用了vi编辑,我只使用了两个功能,点击”i” 开始输入,修改之后,最后 “:wq”保存。模板中是公司的主要信息,比如ZIP邮编、country、city、last_name、industry、eula、title、phone、company、state、department、first_name、email等,命令中只显示英文。

{
“zip” : “97403”,
“country” : “USA”,
“city” : “Springfield”,
“last_name” : “Simpson”,
“industry” : “Energy”,
“eula” : “yes”,
“title” : “Safety Inspection Engineer”,
“phone” : “5558675309”,
“company” : “Example”,
“state” : “OR”,
“department” : “Engineering”,
“first_name” : “Homer”,
“email” : “homer@example.com”
}

3、配置初始化节点

这里必备的操作是配置身份存储设置,而且是不可逆的。我使用了官方的模板直接复制到了下面的文件(使用identityStore 实体中的 json 模板——本地)。

[root@localhost tab]# touch path-to-file.json
[root@localhost tab]# vi path-to-file.json
[root@localhost tab]# vi path-to-file.json
[root@localhost tab]# tsm settings import -f path-to-file.json
[root@localhost tab]# tsm pending-changes apply
正在开始部署异步作业。
作业 ID 为“0”,超时为 10 分钟。
6% - 检索要部署的拓扑。
13% - 检索要部署的配置。
20% - 正在验证新的拓扑。
26% - 正在确定是否需要启动服务器。
33% - 禁用所有服务。
40% - 等待停止服务。
46% - 正在将节点更新为新拓扑。
53% - 等待应用拓扑。
60% - 将节点更新为新配置。
66% - 禁用所有服务。
73% - 等待停止服务。
80% - 重新配置服务。
86% - 正在等待服务重新配置。
93% - 启用所有服务。
100% - 等待启动服务。
已成功使用更新的配置和拓扑版本部署节点。
[root@localhost tab]# tsm status
Status: RUNNING
[root@localhost tab]# tsm version
Tableau 服务管理器命令行版本 20192.19.0518.0639。
Tableau Server 版本 20192.19.0518.0639。

这里我使用的本地策略,因此使用简单的vi命令,在path-to-file.json中输入以下的内容(可以复制粘贴):

{
 "configEntities":{
  "identityStore": {
   "_type": "identityStoreType",
   "type": "local"
   }
  }
}

四、创建管理员账户

初始化完成后,使用创建 Tableau Server 管理员用户帐户。

[root@localhost tab]# tabcmd initialuser --server localhost:80 --username admin

//运行该命令之后,shell 将提示输入用户admin的管理密码。
//也可以在命令后 以“–password ‘password’ ”输入密码,但一定不要忘了空格,否则系统不识别,反而会把后面的部分作为用户名的一部分! 为了避免这个问题,建议用上面的两步操作。

密码:  //输入管理员密码
===== redirecting to http://localhost/auth
===== 已退出
===== 正在创建新会话
===== Server: http://localhost:80
===== Username: tableau
===== 正在连接到服务器...
===== 正在登录...
===== 已成功

至此,完整的Tableau 程序安装就已经完成了。

 

五、其他设置

1、安装驱动程序

Tableau Server提供了广泛的驱动支持,这里一方面我们要安装管理视图所用的PostgreSQL驱动程序,还要安装企业使用的数据库对应的驱动程序,此处安装Oracle。Tableau通过专门的驱动页面,提供了官方的支持,可以从以下网站查询:Tableau支持:驱动程序下载

3.1.1  安装PostgreSQL 驱动程序安装

重要:内置管理视图不会显示,除非您在运行 VizQL Server 进程的所有节点上安装 PostgreSQL 驱动程序。在 CentOS 和 RHEL 上,通过上述网站,先下载rpm文件,然后使用命令安装

下载 .rpm 文件。运行以下命令以安装驱动程序:

sudo yum install tableau-postgresql-odbc-09.06.0500-1.x86_64.rpm

//此处通知客户的服务器管理员提前下载了文件并放在指定目录

[root@localhost 20190626_hou]# yum install tableau-postgresql-odbc-09.06.0500-1.x86_64.rpm
已加载插件:fastestmirror, langpacks
正在检查 tableau-postgresql-odbc-09.06.0500-1.x86_64.rpm: tableau-postgresql-odbc-09.06.0500-1.x86_64
tableau-postgresql-odbc-09.06.0500-1.x86_64.rpm 将被安装
正在解决依赖关系
--> 正在检查事务
---> 软件包 tableau-postgresql-odbc.x86_64.0.09.06.0500-1 将被 安装
--> 解决依赖关系完成
依赖关系解决======================================
Package 架构 版本 源 大小
=================================================
正在安装:
tableau-postgresql-odbc x86_64 09.06.0500-1 /tableau-postgresql-odbc-09.06.0500-1.x86_64 1.2 M

事务概要
====================================
安装 1 软件包

总计:1.2 M
安装大小:1.2 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : tableau-postgresql-odbc-09.06.0500-1.x86_64 1/1
验证中 : tableau-postgresql-odbc-09.06.0500-1.x86_64 1/1

已安装:
tableau-postgresql-odbc.x86_64 0:09.06.0500-1

完毕!

3.1.2 安装服务器 oracle 驱动

【修改】这里可以换一种更简单的办法,无需对方管理员支持,使用命令远程直接远程下载,远程安装。使用上述的驱动支持网站提前获得完整的下载链接,然后使用curl命令(curl -O [link]),如下:

//无法对方管理员支持,直接把驱动下载到本地

[root@localhost ~]# curl -O https://downloads.tableau.com/drivers/linux/yum/tableau-driver/tableau-orale-12.1.0.2.0-1.x86_64.rpm

//终端会自动更新下载进度和时长
  % Total    % Received % Xferd  Average Dload/ Speed Upload/   Time Total /  Time  Spent/   Time Left /Current Speed
100 53.0M  100 53.0M    0     0  3821k      0  0:00:14  0:00:14 --:--:-- 5683k

之后就可以安装驱动:

[root@localhost ~]# sudo yum install tableau-oracle-12.1.0.2.0-1.x86_64.rpm
已加载插件:fastestmirror, langpacks
正在检查 tableau-oracle-12.1.0.2.0-1.x86_64.rpm: tableau-oracle-12.1.0.2.0-1.x86_64
tableau-oracle-12.1.0.2.0-1.x86_64.rpm 将被安装
正在解决依赖关系
--> 正在检查事务
---> 软件包 tableau-oracle.x86_64.0.12.1.0.2.0-1 将被 安装
--> 解决依赖关系完成
依赖关系解决
=====================================

 Package       架构         版本                源                            大小

================================

正在安装:
tableau-oracle    x86_64   12.1.0.2.0-1    /tableau-oracle-12.1.0.2.0-1.x86_64       178 M

事务概要
============================
安装  1 软件包
总计:178 M
安装大小:178 M
Is this ok [y/d/N]: y

Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction

  正在安装    : tableau-oracle-12.1.0.2.0-1.x86_64                                      1/1
ldconfig: 文件 /lib/libiacpkmn.so.3 为空,未检查。
  验证中      : tableau-oracle-12.1.0.2.0-1.x86_64                                      1/1
已安装:
  tableau-oracle.x86_64 0:12.1.0.2.0-1                                                                 
完毕!
[root@localhost ~]#

更多的关于curl的支持,可以参考网站:Curl命令

2、防火墙设置

可以访问官方的文章,获得支持:Tableau 防火墙设置

[root@localhost ~]# firewall-cmd –zone=public –list-ports //查看公开的防火墙端口
80/tcp 8850/tcp
[root@localhost ~]# tsm topology list-ports //查看所有拓扑端口,关键是8850
节点 名称 实例 端口
node1 filestore:primary 0 8878
node1 filestore:status 0 8092
…… (此处我删除了一些)
node1 dataserver:jmx 0 8289
node1 dataserver:jmx.rmi 0 8571
node1 tabadmincontroller:primary 0 8850
node1 elasticserver:primary 0 8897
node1 elasticserver:transport 0 8004
……
node1 gateway:primary 0 80
node1 samlservice:primary 0 8917
node1 tabadminagent:filetransfer 0 8583
node1 tabadminagent:columbo 0 8288
[root@localhost ~]# sudo systemctl start firewalld
[root@localhost ~]# sudo firewall-cmd –get-default-zone
public
[root@localhost ~]# sudo firewall-cmd –set-default-zone=public
Warning: ZONE_ALREADY_SET: public
success
[root@localhost ~]# sudo firewall-cmd –permanent –add-port=80/tcp
Warning: ALREADY_ENABLED: 80:tcp
success
[root@localhost ~]#
[root@localhost ~]# sudo firewall-cmd –permanent –add-port=8850/tcp
Warning: ALREADY_ENABLED: 8850:tcp
success
[root@localhost ~]# sudo firewall-cmd –reload
success
[root@localhost ~]# sudo firewall-cmd –list-all

public (active)
target: default
icmp-block-inversion: no
interfaces: em1 em2
sources:
services: dhcpv6-client ssh
ports: 80/tcp 8850/tcp
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:

3、配置访问代理(非必备)

安装完成后,配置完防火墙,如果需要配置反向代理,需要导入网关配置,使用以下命令:

[root@localhost ~]# cd tab
[root@localhost tab]# ls
path-to-file.jsonregistration_file.json
[root@localhost ~]# cd tab
[root@localhost tab]# ls
path-to-file.jsonregistration_file.json

[root@localhost tab]# vi gateway.json
[root@localhost tab]# vi gateway.json
[root@localhost tab]# tsm settings import -f gateway.json

[root@localhost tab]# tsm pending-changes apply

这里的json文件可以参考官方的说明,我是直接复制过来的。

{
"configEntities": {
"gatewaySettings": {
  "_type": "gatewaySettingsType",
  "port": 80,
  "sslRedirectEnabled": true,
  "publicHost": "localhost",
  "publicPort": 80
}
}
}
屏幕快照 2019-07-04 下午1.06.59.png

至此,完整的安装和配置就算告一段落了。

4、如何查看端口状况

我的这个客户遇到了端口访问问题,其中我们需要用telnet确认,这里可以验证服务器是否可以端口通畅。

//此代码由Tableau工程师Simon提供
[admin@localhost ~]$ telnet 60.216.46.76 8850
Trying 60.216.46.76...
Connected to 60.216.46.76. //连接到了IP地址
Escape character is '^]'.
^CConnection closed by foreign host.
[admin@localhost ~]$ telnet 60.216.46.76 80
Trying 60.216.46.76...
Connected to 60.216.46.76.
Escape character is '^]'.
^C 

其他故障:提示音XXX不在sudoers中,查看博客:https://www.cnblogs.com/liuming1992/p/4882595.html

Jul 2~4, 2019 Shanghai /Jian
Jul 6, 2019 update with help of Simon,Tableau

《【实战】CentOS安装Tableau Server 2019.2(更新2021.4)》有2个想法

  1. Pingback: Tableau Server集群部署之hostname问题 – 喜乐君

  2. Pingback: 【故障排除】Tableau Server集群部署之用户与hostname问题 – 喜乐君

评论已关闭。

了解 喜乐君 的更多信息

立即订阅以继续阅读并访问完整档案。

Continue reading