Tableau uses different processes on different nodes to do the magic: gateway, application servers, repository, cache servers are all having their own configuration files on different server hosts. How can tableau keep their configuration files in sync? How can you change default values or customize the service settings? Like how can I create a remote user access with fix password? Let’s do a deep dive and see how tabadmin configure manages these independent configuration files.
Tabadmin? Ruby? ERB? What?
Little background/history. Few years ago when Tableau started the server development they decided to use ruby programming language to manage different aspects of the server tasks. Tabadmin service, workgroup servers were all written in ruby using jruby (java implementation of ruby). This was a reasonable decision: large agile companies like twitter used ruby in their core implementation. But after a certain point ruby just does not scale (and harder to find good ruby programmers than java ones). That’s why Twitter dropped ruby and rewrite their systems using java and scala. And that’s why Tableau rewrites its ruby related components such as workgroup server or tabcmd from jruby to plain java (like wgserver -> vizportal migration) and I am sure that this will happen with tabadmin and tabadmin service on the long run.
Generating configuration file
But let’s back to our original topic, the configuration management. The basic concept is very simple: you have a mutable user configuration file plus other immutable global configuration files with default values (stored in yaml format) and tabadmin will generate dozen of service dependent configuration files using embedded ruby (ERB) templates.
For instance, generating postgres repository’s access config file pg_hba.conf.templ takes the following (simplified) steps:
- Read %PROGRAMDATA%\Tableau\Tableau Server\config\tabsvc.yml contents
- Read %PROGRAMFILES%\Tableau\Tableau Server\9.0\templates\config-defaults.yml contents
- Read %PROGRAMFILES%\Tableau\Tableau Server\9.0\templates\customization-defaults.yml contents
- Read %PROGRAMFILES%\Tableau\Tableau Server\9.0\templates\pg_hba.conf.templ contents (this is the ERB template file)
- Validate all configuration settings
- Execute ERB template on pg_hba.conf.templ using the configuration contents, default calculations and validation rules.
- Store the result in %ProgramData%\Tableau\Tableau Server\data\tabsvc\config\pg_hba.conf
This will be executed on all nodes in a cluster.
Quick look in the pg_hba.conf.templ:
# local connections:
<% IPUtil.new().with_all_local_ips do |address| %>
host all <%= AppConfig.jdbc.username %> <%= address %> <%= main_server_auth_method %>
host all <%= AppConfig.pgsql.adminusername %> <%= address %> <%= main_server_auth_method %>
host all <%= AppConfig.pgsql.remote_username %> <%= address %> md5
host all <%= AppConfig.pgsql.readonly_username %> <%= address %> md5
host all all <%= address %> md5
<% end %>
This will compile as:
# local connections:
host all rails 127.0.0.1/32 md5
host all tblwgadmin 127.0.0.1/32 md5
host all tableau 127.0.0.1/32 md5
host all readonly 127.0.0.1/32 md5
host all all 127.0.0.1/32 md5
host all rails 0:0:0:0:0:0:0:1/128 md5
host all tblwgadmin 0:0:0:0:0:0:0:1/128 md5
host all tableau 0:0:0:0:0:0:0:1/128 md5
host all readonly 0:0:0:0:0:0:0:1/128 md5
host all all 0:0:0:0:0:0:0:1/128 md5
host all rails 10.86.13.244/32 md5
host all tblwgadmin 10.86.13.244/32 md5
host all tableau 10.86.13.244/32 md5
host all readonly 10.86.13.244/32 md5
host all all 10.86.13.244/32 md5
Changing the configuration template will ensure to have your customization effective after tabadmin configure.
How about service property files?
Great question, and not just because I asked it. There are few files which aren’t generated from ERB templates. These includes special property files like connections.properties or connections.yml where an embedded logic inside tabadmin generates these configuration files.
Other files like <servicename>.properties are generated from component configurations. These files having their logic implemented in tabadmin’s component classes. Bad news, you can’t change them directly, only thru changing the default files.
tabadmin configure does way more than just template generation. Registering the tableau events for event logging, modifying Oracle’s NLS_LANG setting in registry just to name few. Tabadmin also handles the version changes: after upgrade the first tabadmin configure run updates the local user-specific configuration file according to the latest configuration standards and requirements.
In the next post I will show you how to create your own superuser in tableau repository including remote access support. This will allows you to modify workbooks on the fly remotely – purely connecting to the repository database.
Any questions? Drop a line.
Latest posts by Tamás Földi (see all)
- Tableau Performance: Why Embedded Data Source is Faster than Published - April 16, 2017
- Tableau Save as Previous Version feature - February 20, 2017
- Inside Tableau Desktop – DebugMenu, Override, GammaRay - December 6, 2016