Tableau 10.5新機能:Tableau Server on Linux(ベータ版)のインストールを試してみた(Amazon EC2/CentOS7) #tableau

2017.12.22

この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。

Tableauプロダクトは現在バージョン10.5が最新ベータ版の状態で展開されている状況となっています。製品リリース版はまだもう少し先の話となりますが、下記サイトから申込を行う事でベータ版を試してみる事は可能です。当エントリでは正式リリースに先駆けて10.5の新機能について「試してみた」内容を紹介してみたいと思います。

当エントリでご紹介する10.5新機能の内容は「Tableau Server on Linux」です。

Tableau Serverのバージョンは安定版リリースの最新がv10.4となっていますが、以前から「Tableau ServerのLinux版を出して欲しい」という要望は挙がっていました。そしてv10.5となる次回リリースに於いて、ようやく待望のLinux版が出る運びとなりました。

現在、v10.5はベータ版のステータスのためまだ一般利用・本番利用は出来ない形ではありますが、ユーザー登録&申請を行う事で(ベータ版としての)動作・挙動確認を行う事が可能です。そこで当エントリではベータ版時点でのTableau Server on Linuxのコマンドによるインストールを試してみたいと思います。

※当エントリの内容は2017年12月中旬時点での「ベータ版」での実践内容となり、正式リリース版とは挙動や内容が異なる場合があります事をご了承ください。

目次

Tableau Serverインストール環境(EC2/CentOS7)の構築

当エントリで行う作業については、以下公式ドキュメントの内容に基いて進めます。

今回はLinux系のAmazon EC2インスタンスに対してTableau Server on Linuxを導入する方向で進めたいと思います。Tableau Server on Linuxに関する要件および推奨事項については以下に記載がまとまっています。今回はOS環境として「CentOS 7」を選びました。

OSイメージの最新公式AMI IDは以下のサイトから情報を確認可能です。

構築対象のリージョンに該当するAMI IDをコミュニティAMIから探し出し、インスタンス構築を進めてください。

環境のスペックについても必須・推奨要件が存在します。ここではインストール確認用という事でインスタンスタイプをm4.2xlargeで指定してみました。その他の指定内容として、セキュリティグループについてはインスタンス固有のものを1つ新設、またストレージ容量については100GBで進めました。(※この辺りは要件や状況に拠って異なってくるかと思いますので臨機応変に御対応ください)

KeyPairを作成しつつインスタンスを起動。インスタンスにEIPを割当て、起動後のインスタンスにユーザーcentosでログインします。

$ chmod 400 cm-tableau-server-linux-key.pem 
$ ssh -i cm-tableau-server-linux-key.pem centos@xxx.xx.xxx.xx
$ cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)

インストール前の事前準備

今回、環境下でAWS CLIを使いたかった&OS環境下のPythonのバージョンが2.x系だったのでこのタイミングでPython3.x系に環境入替え&AWS CLIのインストールも併せて行いました。(※なので不要であれば手順をスキップしてください)

## 現行導入バージョンを確認
$ python --version
Python 2.7.5

## 必要なブツをインストール
$ sudo yum -y groupinstall "Development Tools"
$ sudo yum -y install mlocate openssl-devel bzip2-devel
$ sudo yum -y install zlib-devel bzip2 bzip2-devel readline-devel sqlite3 sqlite-devel
$ sudo yum -y install gcc gcc-c++

## Gitの導入&バージョンを確認
$ git --version
git version 1.8.3.1

## pyenv導入・設定作業実施
$ git clone https://github.com/yyuu/pyenv.git ~/.pyenv
Cloning into '/home/centos/.pyenv'...
remote: Counting objects: 15806, done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 15806 (delta 9), reused 15 (delta 7), pack-reused 15786
Receiving objects: 100% (15806/15806), 2.82 MiB | 0 bytes/s, done.
Resolving deltas: 100% (10786/10786), done.

## .bashrcに下記コードを追記(「#User specific aliases and functions」配下)
$ vi ~/.bashrc
----
# User specific aliases and functions
export PYENV_ROOT="${HOME}/.pyenv"
if [ -d "${PYENV_ROOT}" ]; then
export PATH=${PYENV_ROOT}/bin:$PATH
eval "$(pyenv init -)"
fi
----

## 設定反映
$ source .bashrc

## Python3.x系のインストール・切替・切替後のバージョン確認
$ pyenv install --list
$ pyenv install 3.6.3
$ pyenv global 3.6.3
$ pyenv rehash
$ python --version
Python 3.6.3

## AWS CLIのインストール
$ curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
$ python get-pip.py
$ pip install awscli
$ aws --version
aws-cli/1.14.11 Python/3.6.3 Linux/3.10.0-514.10.2.el7.x86_64 botocore/1.8.15

## AWS CLI設定
$ aws configure
AWS Access Key ID [None]: AKIAXXXXXXXXXXXXXXXX
AWS Secret Access Key [None]: f3XDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Default region name [None]: us-east-1
Default output format [None]:
$

Tableau Server on Linux:パッケージのインストール

環境のインストール作業自体は非常にシンプルです。所定のパッケージをOS環境下にダウンロードしておき、yumコマンドを実行するだけ。

$ sudo yum -y install tableau-server-10.5-beta5-1.x86_64.rpm
Loaded plugins: fastestmirror
Examining tableau-server-10.5-beta5-1.x86_64.rpm: tableau-server-10500.17.1030.1652-10500-17.1030.1652.x86_64
Marking tableau-server-10.5-beta5-1.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package tableau-server-10500.17.1030.1652.x86_64 0:10500-17.1030.1652 will be installed
--> Processing Dependency: fontconfig for package: tableau-server-10500.17.1030.1652-10500-17.1030.1652.x86_64
Loading mirror speeds from cached hostfile
 * base: mirror.math.princeton.edu
 * extras: mirror.cs.vt.edu
 * updates: mirrors.advancedhosters.com
--> Processing Dependency: fuse for package: tableau-server-10500.17.1030.1652-10500-17.1030.1652.x86_64
:
:

途中、環境が(推奨)要件を満たしていないという事で以下のメッセージが表示されていました。この辺りはWindows環境で進めた時と流れは同じですね。

<<英文>> 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 8 cores, but found only 4 core(s).

<<日本語訳>> 実稼働環境でTableau Serverを実行する予定の場合は、 次のハードウェア仕様を推奨します。: http://www.tableau.com/products/server/specs Tableau Serverは少なくとも8コアで最適に動作しますが、4コアしか見つかりませんでした。

(※要件の確認 - ハードウェア要件より:)

注: Amazon Web Services および Google Cloud Platform でのパブリック クラウド展開の場合、その "vCPU" は完全な CPU コアではなく、実際には CPU ハイパースレッドである場合があります。クラウドのインスタンスをサイズ変更する場合、Tableau Server の CPU コア要件として指定されるサイズの 2 倍の vCPU が必要になります (トライアルの最小インストールで 4 vCPU、推奨インストールでは 16 vCPU)。
:
:
  Installing : redhat-lsb-submod-security-4.1-27.el7.centos.1.x86_64                                                                                   36/38 
  Installing : redhat-lsb-core-4.1-27.el7.centos.1.x86_64                                                                                              37/38 

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 8 cores, but found only 4 core(s).

  Installing : tableau-server-10500.17.1030.1652-10500-17.1030.1652.x86_64                                                                                         38/38 

If this is a single node or initial node installation, run:

    sudo /opt/tableau/tableau_server/packages/scripts.10500.17.1030.1652/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.

  Verifying  : libXext-1.3.3-3.el7.x86_64                                                                                                                           1/38 
  Verifying  : libX11-1.6.5-1.el7.x86_64                                                                                                                            2/38
:

今回の場合は上記の形でメッセージは出ていますが、インストール作業自体は特に問題はないのでこのまま進めます。(※Enter押下で継続) Complete!のメッセージを確認後、次の作業へ。

:
  mesa-libglapi.x86_64 0:17.0.1-6.20170307.el7                   psmisc.x86_64 0:22.20-15.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                         stix-fonts.noarch 0:1.1.0-5.el7                    
  time.x86_64 0:1.7-45.el7                                      

Complete!
$

各種設定作業

tsmの起動

次に行う作業は、Tableau Server for Linux をサポートする Tableau Services Manager (TSM) コマンド ライン インターフェイス(CLI)を用いて行います。tsmに関する情報の詳細は以下リファレンスをご参照ください。

/opt/tableau/tableau_server/packages/scripts.<所定のバージョン>/へのディレクトリ移動を行った後、sudo権限で./initialize-tsm --accepteulaを実行。途中tsmadminグループが作成されている事が確認出来ますが、このグループは後で活用します。

$ cd /opt/tableau/tableau_server/packages/scripts.10500.17.1030.1652/
after-install              config.json                initialize-tsm-common      sudoers-centos.txt         tableau-server-obliterate  
after-install-common       defaults.bash              move-tsm-controller        sudoers.txt                tsm.autocomplete           
before-remove              initialize-tsm             README                     sudoers-ubuntu.txt         upgrade-tsm
[centos@ip-10-0-0-119 scripts.10500.17.1030.1652]$ sudo ./initialize-tsm --accepteula
Creating 'tableau' group for Tableau Server
Creating 'tsmadmin' group for TSM admin authorization
Creating 'tableau' unprivileged user account
Creating 'tsmagent' privileged user account
Creating directories and setting permissions...
Using '/var/opt/tableau/tableau_server' as the data directory.
Adding user 'centos' to group 'tableau'...
Adding user 'centos' to group '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.
Adding sudo capability for privileged user...
Creating environment file...
Starting TSM services...
TSM services started successfully
Use the 'tsm' command to continue setting up Tableau 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 REST API endpoint is available at
ip-10-0-0-119.ec2.internal:8850
Use the TSM command line interface to interact with TSM. There is no browser-accessible web UI in this release.
You will be prompted to authenticate, or can log in using the username 'centos', with the same password you used to log into this session (or any other username in the administrative group and with its password).
Done.

程無くして処理が完了するので一旦サーバからログアウトします。

$ exit
logout
Connection to xxx.xx.xxx.xx closed.

セットアップ作業用ユーザーの作成

以降の作業についてもtsmコマンドを用いて行うのですが、作業実施前にログイン処理を求められます。上記までの作業で用いていたcentosユーザーはパスワード入力無しでsudo実行が行えるため、この作業実施に適していないと判断。この後続くセットアップ作業用に別途認証パスワード設定を行ったユーザーを作成し、そのユーザーで進めてみる事にしました。

セットアップ作業用ユーザーとしてshinyaa31というユーザーをパスワード設定付きで作成。

$ sudo useradd shinyaa31
$ sudo passwd shinyaa31
Changing password for user shinyaa31.
New password: (****************)
Retype new password: (****************)
passwd: all authentication tokens updated successfully.

作成ユーザーをroot実行権限を有するグループ、及び上記で作成されたtsadminグループに追加。所定のグループに属している事を確認します。

$ sudo gpasswd -a shinyaa31 wheel
Adding user shinyaa31 to group wheel
$ sudo gpasswd -a shinyaa31 tsmadmin
Adding user shinyaa31 to group tsmadmin
$ id shinyaa31
uid=1001(shinyaa31) gid=1001(shinyaa31) groups=1001(shinyaa31),10(wheel),992(tsmadmin)
$

参考までに、tsmコマンドのヘルプ表示内容。

$ tsm help

Tableau Services Manager command line Utility -- 10500.17.1030.1652

Available commands:
tsm authentication <command> [parameters]             -- Category of commands related to setting up authentication in TSM
tsm configuration <command> [parameters]              -- Category of commands related to server configuration.
tsm customize [parameters]                            -- Set customization for Tableau Server.
tsm data-access <command> [parameters]                -- Category of commands related to data-access.
tsm help <category> | [category] <command> | commands -- Help for tsm commands.
tsm initialize [parameters]                           -- Initialize Tableau Server.
tsm jobs <command> [parameters]                       -- Category of commands related to async jobs.
tsm licenses <command> [parameters]                   -- Category of commands related to licensing.
tsm login [parameters]                                -- Sign in to the TSM agent.
tsm logout                                            -- Sign out from the TSM agent.
tsm maintenance <command> [parameters]                -- Category of commands related to maintenance.
tsm pending-changes <command> [parameters]            -- Category of commands for pending changes.
tsm register [parameters]                             -- Register the product.
tsm restart [parameters]                              -- Restart Tableau Server.
tsm security <command> [parameters]                   -- Category of commands related to security configuration.
tsm settings <command> [parameters]                   -- Category of commands related to configuration and topology settings
tsm sites <command> [parameters]                      -- Category of commands related to site import and export.
tsm start [parameters]                                -- Start Tableau Server.
tsm status [parameters]                               -- View Tableau Server status.
tsm stop [parameters]                                 -- Stop Tableau Server.
tsm topology <command> [parameters]                   -- Category of commands related to server topology.
tsm user-identity-store <command> [parameters]        -- Category of commands related to user-identity-store
tsm version                                           -- Displays version information.

tsm help <category> | [category] <command> | commands

Global options:
    -h,--help                     Display TSM help.
    -p,--password <PASSWORD>      Use the specified password.
       --request-timeout <arg>    Seconds to wait for command to finish.
    -s,--server <URL>             Use the specified Tableau Services Manager
                                  URL. If no protocol is specified,
                                  https://<localhost dnsname>:8850 is assumed.
    -u,--username <USER>          Use the specified user name.

Tableau Serverのアクティブ化・登録作業の実施

上記で作成したユーザーを用い、tsm loginコマンドでログイン。

$ tsm login -u shinyaa31
Password: (****************)
$

tsm licenses activateでライセンスのアクティベート実行。

$ tsm licenses activate -k TSKH-XXXX-XXXX-XXXX-XXXX
License key activated.

tsm register --templateコマンドで登録用に用いるライセンスファイル テンプレートを作成。

$ tsm register --template > /home/shinyaa31/registration_file.json
$ cat registration_file.json 
{
  "zip" : "[value]",
  "country" : "[value]",
  "city" : "[value]",
  "last_name" : "[value]",
  "industry" : "[value]",
  "eula" : "[value]",
  "title" : "[value]",
  "phone" : "[value]",
  "company" : "[value]",
  "state" : "[value]",
  "department" : "[value]",
  "first_name" : "[value]",
  "email" : "[value]"
}
$

各種項目に登録内容を書き入れつつ(※記入例が「Tableau Server のアクティブ化と登録」ページ内の"Tableau Server の登録"の項にありますのでご参考ください)、編集が済んだファイルを用いてtsm register --file (対象ファイルパス)コマンドを実行します。

$ tsm register --file /home/shinyaa31/registration_file.json 
Registration complete.
$ exit
logout

ローカルファイアウォールの設定

続いてはファイアウォール設定。以下3つのポートを許可する内容となっています(HTTPS通信が必要なら443もですね)。今回は導入環境がAWS EC2なので、ここはドキュメントの内容に従うのでは無く、EC2のセキュリティグループで対応します。

  • UDP:2233
  • TCP:8850
  • TCP:80

予め作成しておいたEC2に紐付くセキュリティグループに上記内容を追記。下記例では検証用のためアクセス可能ソースを全通しにしちゃってますが、この部分は本番運用する場合、適切なアクセス制御を行う形としてください。

各種設定の構成

各種設定の構成作業については必要なものを実施します。詳細な手順については上記「最初のノードで設定を構成する」に記載がありますが、今回は「ジャンプ スタート インストール」記載の内容に沿って進めてみることにします。

「ステップ 4: アイデンティティ ストアの構成」より、アイデンティストアの構成を実施。所定のパスに存在するconfig.jsonを使います。中身はこんな感じ。

$ cd /opt/tableau/tableau_server/packages/scripts.10500.17.1030.1652/
$ cat config.json 
{
  "configEntities": {
    "identityStore": {
      "_type": "identityStoreType",
      "type": "local"
    }
  }
}

インポート作業実施。

$ su - shinyaa31
Password: 
Last login: Mon Dec 18 09:14:46 UTC 2017 on pts/1
$ tsm settings import -f /opt/tableau/tableau_server/packages/scripts.10500.17.1030.1652/config.json 
$

インストールのファイナライズ→Tableau Server起動

インストールの仕上げ作業として、「ファイナライズ」及びTableau Serverの起動を行います。

tsm pending-changes applyコマンドの実行。

$ tsm pending-changes apply
This operation will perform a server restart. Are you sure you wish to continue?
(y/n): y
Starting deployments asynchronous job.
9% - Retrieving the topology to deploy.
18% - Retrieving the configuration to deploy.
27% - Validating the new topology.
36% - Determining if server needs to be started.
45% - Disabling all services.
54% - Waiting for the services to stop.
63% - Updating nodes to new topology.
72% - Waiting for topology to be applied.
81% - Updating nodes to new configuration.
90% - Reconfiguring services.
100% - Waiting for services to reconfigure and start.   
Successfully deployed nodes with updated configuration and topology version.

tsm initializeコマンドでサーバ初期化。

$ tsm initialize --start-server --request-timeout 1800
Initializing the server...
3% - Validating that there are no pending changes.
7% - Generating passwords.
11% - Initializing the topology.                                  
14% - Checking if required database services are present.
18% - Disabling database services.    
22% - Installing the maintenance app.    
25% - Connecting to the database maintenance app at host: 'localhost', port: '8008'.
29% - Initializing the temporary database instance.    
33% - Starting the temporary database instance.    
37% - Creating roles and databases.
40% - Running migrations.    
44% - Localizing the default projects.
48% - Stopping the temporary database instance.    
51% - Making the temporary database default.    
55% - Enabling the database services.    
59% - Removing the database maintenance app.    
62% - Generating new asset key.
66% - Saving asset key.
70% - Finalizing the topology.                                    
74% - Reconfiguring services.
77% - Waiting for services to reconfigure and start.    
81% - Initializing the next active repository.
85% - Enabling the services required for indexing.    
88% - Rebuilding the search index.    
92% - Finalizing the initialization.    
96% - Enabling all services.    
100% - Waiting for the services to start.   

Server was initialized successfully.

tsm startコマンドでTableau Serverの起動。

$ tsm start --request-timeout 900
Starting service...
Service was started successfully.

初期管理ユーザーの作成にはtabcmdコマンドを使います。以下はヘルプオプションによる「出来ること一覧」。

$ tabcmd --help
Tableau Server Command Line Utility -- 10500.17.1030.1652

tabcmd help             -- Help for tabcmd commands
tabcmd help <a command> -- Show Help for a specific command
tabcmd help commands    -- List all available commands

tabcmd help <a command> | commands
Command options:
Global options:
       --[no-]cookie             Do not save the session ID when signing in.
                                 Subsequent commands will need to sign in again.
                                 If unspecified, default is to save the session
                                 ID
    -c,--use-certificate         Use client certificate to sign in
    -h,--help                    Display tabcmd Help
       --no-certcheck            Do not validate the SSL certificate
       --no-prompt               Do not prompt for a password
       --no-proxy                Do not use a HTTP proxy
    -p,--password <PASSWORD>     Use the specified Tableau Server password
       --password-file <FILE>    Read the Tableau Server password from FILE
    -s,--server <URL>            Use the specified Tableau Server URL. If no
                                 protocol is specified, http:// is assumed
    -t,--site <SITEID>           Use the specified Tableau Server site. Specify
                                 an empty string ("") to force use of the
                                 default site
       --timeout <SECONDS>       How long to wait, in seconds, for the server to
                                 complete processing the command. The default is
                                 to wait until the server responds
    -u,--username <USER>         Use the specified Tableau Server user name
    -x,--proxy <HOST:PORT>       Use the specified HTTP proxy

tabcmd initialuserコマンドで任意のユーザー名、パスワードを指定してユーザを作成。

$ tabcmd initialuser --server "localhost:80" --username "cmtabserverlinuxadmin" --password "XXxxXXxxXX"
===== redirecting to http://localhost/auth
===== Signed out
===== Creating new session
=====     Server:   http://localhost:80
=====     Username: cmtabserverlinuxadmin
===== Connecting to the server...
===== Signing in...
===== Succeeded
$

動作確認

Tableau Serverアクセス確認

これで準備が整いました。ブラウザを起動し、対象となるURL(今回はEIPをインスタンスに割当てていたのでEIP)にアクセス。サインイン画面が出てくるので必要事項を設定してサインイン実施。

無事アクセス出来ました!

Tableau Serverの構成情報を確認してみます。OSの情報がLinuxである事がわかりますね。

データソース用ドライバのインストール

Tableau Server環境自体は上記手順でインストールが完了となりますが、利用するデータソースに対応するドライバは個別にインストールする必要があります。上記環境に対してAmazon Redshiftのデータソースを用いて作成したTableau Desktopのコンテンツをサーバにパブリッシュした後、

そのコンテンツにアクセスすると以下の様な形でエラーメッセージが表示されました。

関連するドライバの導入方法については下記ページにその詳細手順が展開されています。ここではAmazon Redshiftのドライバインストール方法について実際に試してみました。

まずはドライバインストーラのダウンロード&インストール。(※ドキュメントではdnfを使う記載がありましたがいまいち動かなかったのでyumで作業を進めました)

$ wget https://s3.amazonaws.com/redshift-downloads/drivers/AmazonRedshiftODBC-64bit-1.3.7.1000-1.x86_64.rpm
$ sudo yum -y install AmazonRedshiftODBC-64bit-1.3.7.1000-1.x86_64.rpm

次いで設定ファイルへの追記。ファイル自体は存在していなかったので新規作成する形となりました。

$ sudo vi /etc/odbcinst.ini
---(以下内容を記載)---
[Amazon Redshift (x64)]
Description=Amazon Redshift ODBC Driver(64-bit)
Driver=/opt/amazon/redshiftodbc/lib/64/libamazonredshiftodbc64.so

以下のファイルはインストール時に作成されているものを書き換えます。

$ sudo vi /opt/amazon/redshiftodbc/lib/64/amazon.redshiftodbc.ini
---(以下内容に変更)---
[Driver]
## - Note that this default DriverManagerEncoding of UTF-32 is for iODBC.
##DriverManagerEncoding=UTF-32
##ErrorMessagesPath=/opt/amazon/redshiftodbc/ErrorMessages
##LogPath=[LogPath]
##SwapFilePath=/tmp
DriverManagerEncoding=UTF-16
ErrorMessagesPath=/opt/amazon/redshiftodbc/ErrorMessages
LogPath=/tmp
SwapFilePath=/tmp

#   iODBC
##ODBCInstLib=libiodbcinst.so
ODBCInstLib=libodbcinst.so

念のためサーバを再起動。

$ tsm login -u shinyaa31 -p XXXxxxXXXxxx
$ tsm restart
Stopping service...
Service stopped successfully.
Starting service...
Service was started successfully.

改めてアクセスし直してみると、今度はちゃんと表示出来ました!対応するデータソースのドライバについてはこのような形で適宜必要なものを追加インストールしてください。

まとめ

という訳でTableau Server on Linux、ベータ版をCentOSに導入してみたエントリのご紹介でした。手順としては非常にシンプルではありますし、大きく詰まるような所も無さそうに思えます。一方で「10.4までのWindows版で出来ていたこれは、10.5で新しく出て来るLinux版ではどうなっているのか?」というのも幾つかあると思っており、その辺りは気になるところです。今後正式リリースされた暁には比較検証してみたいと思います。