コラム
はじめに
こんにちはクラウドCoEの城前です。今回はAWS上でTableau Serverを構築する際に、Tableau Serverのリポジトリを外部サービスとしてAWSのRDSで構築する方法について説明していきたいと思います。
Tableau Server リポジトリとは
Tableau Server リポジトリとは、すべてのユーザー インタラクション、抽出の更新などに関するデータを格納する PostgreSQL データベースとなります。リポジトリは、Tableau Server と同じノードにローカルでインストールするか、外部にインストールすることができます。
注:外部リポジトリを使用する場合、Server Management アドオン ライセンスが必要になります。
ローカルリポジトリ: PostgreSQL データベースがローカルにインストールおよび展開されます。つまり Tableau Server と共に展開されます。
外部リポジトリ: PostgreSQL データベースは外部に展開されます。外部リポジトリは、Amazon RDS、Azure Database にインストールするか、またはスタンドアロンとしてインストールすることができます。
今回はAmazon RDSにインストールする方法を説明したいと思います。
構築にあたっての注意点
Amazon RDSを外部リポジトリとして使用する場合、以下の要件と推奨事項があります。
- Amazon RDSの推奨の最小スペックは 8 個の vCPU と 32GB の RAMのインスタンスとなっています。要件や使用方法によりさらにパフォーマンスを向上させたい場合は16 個の vCPU と 128GB の RAM を備えた、メモリに最適化されたインスタンス タイプを使用することが推奨されています。(作成後により大きなサイズにアップグレードすることも可能です)
- Tableau Server と外部 PostgreSQL DB インスタンス間はSSL/TLSで接続を行うことが推奨されています。
- Tableau ServerからAmazon RDSへ到達可能にする必要があります。具体的にはTableau Serverからのアクセスを許可するセキュリティグループを作成しAmazon RDSに設定する必要があります。
- PosgreSQL のバージョンは、Tableau Server をローカルにインストールするときに使用するバージョンと一致する必要があります。現時点(2022年5月)で最新のバージョンであるTableau Server 2022.1で使用されているPosgreSQL のバージョンは「13.4」となっています。
- PostgreSQL パラメーターは基本的にはデフォルトで問題はないですが、「standard_conforming_strings」、「escape_string_warning」については変更することが推奨されています。また、「work_mem」についてはパフォーマンスの問題を回避するために16384以上の値を設定することが推奨されています。
- 外部リポジトリが Tableau Server とともに正しく動作するための要件として、マスターユーザ名として「rails」を設定する必要があります。パスワードは任意で構いません。
- 初期データベースはTableau Server によって作成されるため、RDS作成時に作成する必要はありません。
- IAM DB認証は無効にする必要があります。
- ポートは任意のものを設定可能ですが、規定(5432)を使用することが推奨されています。
- マイナーバージョン自動アップグレードは無効にする必要があります。Tableau Server は特定のバージョンの PostgreSQL を使用する必要があり、Tableau Server アップグレードの際は必要に応じて PostgreSQL バージョンをアップグレードするように求められます。
参考までにCloudFormationでRDSを作成する場合のテンプレートは以下のようになります。パラメータや設定値は環境に合わせて適宜変更してご利用ください。
AWSTemplateFormatVersion: "2010-09-09"
Description:
Create RDS
# ------------------------------------------------------------#
# Input Parameters
# ------------------------------------------------------------#
Parameters:
SystemName:
Type: String
Default: "TestSystem"
DBInstanceIdentifier:
Description: The Amazon RDS DB Instance Identifier name.
Type: String
DatabaseMasterUsername:
AllowedPattern: ^([a-zA-Z0-9]*)$
Description: The Amazon RDS master username.
ConstraintDescription: Must contain only alphanumeric characters (minimum 8; maximum 16).
MaxLength: 16
MinLength: 5
Type: String
Default: "rails"
DatabaseMasterPassword:
AllowedPattern: ^([a-z0-9A-Z`~!#$%^&*()_+,\\-])*$
ConstraintDescription: Must be letters (upper or lower), numbers, and these special characters '_'`~!#$%^&*()_+,-
Description: The Amazon RDS master password.
MaxLength: 41
MinLength: 8
NoEcho: true
Type: String
mySubnetIDs:
Description: The Amazon RDS Subnet IDs
Type: "List<AWS::EC2::Subnet::Id>"
KmsArn:
Description: The Amazon RDS Kms Arn
Type: String
RdsSecurityGroup:
Description: The Amazon RDS Security Group
Type: "AWS::EC2::SecurityGroup::Id"
Resources:
# ------------------------------------------------------------#
# Subnet Group
# ------------------------------------------------------------#
DataSubnetGroup:
Type: AWS::RDS::DBSubnetGroup
Properties:
DBSubnetGroupDescription: RDS Database Subnet Group
DBSubnetGroupName: !Sub "rds-sub-${SystemName}"
SubnetIds: [ !Select [ 0, !Ref mySubnetIDs ], !Select [ 1, !Ref mySubnetIDs ] ]
# ------------------------------------------------------------#
# Parameter Group
# ------------------------------------------------------------#
DBParameterGroup:
Type: AWS::RDS::DBParameterGroup
Properties:
Description: My Parameter group
Family: postgres13
Parameters:
standard_conforming_strings: 0
escape_string_warning: 0
work_mem: 16384
# ------------------------------------------------------------#
# Role
# ------------------------------------------------------------#
RDSIAMRole:
Type: AWS::IAM::Role
Properties:
RoleName: !Sub "role-${SystemName}"
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Principal:
Service:
- monitoring.rds.amazonaws.com
Action:
- sts:AssumeRole
Path: /
ManagedPolicyArns:
- arn:aws:iam::aws:policy/service-role/AmazonRDSEnhancedMonitoringRole
# ------------------------------------------------------------#
# DB Instance
# ------------------------------------------------------------#
DatabaseInstance0:
Type: AWS::RDS::DBInstance
DeletionPolicy: Delete
Properties:
AllocatedStorage: 200
MaxAllocatedStorage: 1000
AllowMajorVersionUpgrade: false
AutoMinorVersionUpgrade: false
BackupRetentionPeriod: 30
CopyTagsToSnapshot: true
# DBName:
DBSubnetGroupName: !Ref DataSubnetGroup
DBInstanceClass: db.m5.2xlarge
DBInstanceIdentifier: !Ref DBInstanceIdentifier
DBParameterGroupName: !Ref DBParameterGroup
Engine: postgres
EngineVersion: 13.4
LicenseModel: postgresql-license
MasterUsername: !Ref DatabaseMasterUsername
MasterUserPassword: !Ref DatabaseMasterPassword
MonitoringInterval: 60
MonitoringRoleArn: !GetAtt RDSIAMRole.Arn
MultiAZ: false
Port: 5432
PreferredMaintenanceWindow: Mon:06:00-Mon:07:00
PreferredBackupWindow: 05:00-05:30
PubliclyAccessible: false
StorageEncrypted: true
KmsKeyId: !Ref KmsArn
StorageType: io1
Iops: 3000
CACertificateIdentifier: rds-ca-2019
EnablePerformanceInsights: true
PerformanceInsightsRetentionPeriod: 7
PerformanceInsightsKMSKeyId: !Ref KmsArn
VPCSecurityGroups:
- !Ref RdsSecurityGroup
構築方法
RDSの作成が完了したら、Tableau Server側で外部リポジトリの利用設定を行います。
今回はEC2にTableau Serverを構築する手順から説明します。
①インストール
現時点での最新版「tableau-server-2022-1-1.x86_64.rpm」をインストールします。
# wget https://downloads.tableau.com/esdalt/2022.1.1/tableau-server-2022-1-1.x86_64.rpm # yum -y install tableau-server-2022-1-1.x86_64.rpm
②TSM初期化
# cd /opt/tableau/tableau_server/packages/scripts.20221.22.0415.1144/ # sudo ./initialize-tsm --accepteula # source /etc/profile.d/tableau_server.sh
③Tableau Serverライセンス認証
ライセンス情報を登録します。
# tsm licenses activate -k <product key>
④TSMログイン用ユーザ作成
TSMログイン用のユーザを作成しパスワードを設定します。さらに「tsmadmin」グループに所属させます。
# sudo adduser <User Name> # sudo passwd <User Passwork> # sudo usermod -G tsmadmin -a <User Name>
⑤Tableau Server登録
登録用のテンプレートを作成し、編集を行ったうえでTableau Serverへ必要情報を登録します。
# tsm register --template > /tmp/registration_file.json
# cat /tmp/registration_file.json
{
"zip" : "[value]",
"country" : "[value]",
"city" : "[value]",
"last_name" : "[value]",
"industry" : "[value]",
"eula" : "[value]",
"title" : "[value]",
"company_employees" : "[value]",
"phone" : "[value]",
"company" : "[value]",
"state" : "[value]",
"opt_in" : "[value]",
"department" : "[value]",
"first_name" : "[value]",
"email" : "[value]"
}
# tsm register --file /tmp/registration_file.json
⑥アイデンティティストア設定
「path-to-file.json」というファイルを任意のディレクトリ上に作成し、以下の内容を記述します。
次にpath-to-file.jsonをTableau Serverに適用させます。
# vi /tmp/path-to-file.json
-------
{
"configEntities":{
"identityStore": {
"_type": "identityStoreType",
"type": "local"
}
}
}
--------
# tsm settings import -f /tmp/path-to-file.json
# tsm pending-changes apply
⑦外部リポジトリ設定
「db.json(任意)」というファイルを任意のディレクトリに作成。
RDSとのSSL/TLS接続のため、CA証明書をダウンロードしたうえで、外部リポジトリの登録を行います。
# vi /tmp/db.json
---------------------------
{
"flavor":"rds",
"masterUsername":"rails",
"masterPassword":"<Password>",
"host":"<RDS Endpoint URL>",
"port":5432
}
---------------------------
# wget -P /tmp https://s3.amazonaws.com/rds-downloads/rds-ca-2019-root.pem
# tsm topology external-services repository enable -f /tmp/db.json -c /tmp/rds-ca-2019-root.pem
# tsm pending-changes apply
⑧
# tsm initialize --start-server --request-timeout 1800
⑨確認
最後にTSM のステータスページから、リポジトリがTableau Server 外部サービスとして表示されていることを確認します。
以上です。皆さんのお役に立てれば幸いです!
-
PICK UP
ピックアップ
-
ピックアップコンテンツがありません
-
RANKING
人気の記事
-
-
1
Lambdaのマルチアカウントデプロイ 設計編
Lambdaのマルチアカウントデプロイ 設計編
2021/03/01
-
2
AWS CloudFormationでBlueGr…
AWS CloudFormationでBlueGreenデプロイを実現してみた(…
2019/11/25
-
3
[ECS/Fargate] CI/CDでのバッチジ…
[ECS/Fargate] CI/CDでのバッチジョブ実行基盤 ~2つのCode…
2022/03/28
-
4
Azureのコスト情報をTeamsで通知する方法
Azureのコスト情報をTeamsで通知する方法
2023/06/14
-
5
DevOps、その遙かなる道程(第2回)
DevOps、その遙かなる道程(第2回)
2019/08/30
-
-
ARCHIVE
アーカイブ
-
- January 2024 (1)
- December 2023 (2)
- June 2023 (2)
- May 2023 (1)
- April 2023 (1)
- March 2023 (2)
- February 2023 (2)
- January 2023 (1)
- December 2022 (2)
- October 2022 (2)
- September 2022 (2)
- August 2022 (1)



