Monday, 19 February 2018 11:01

Automating Multi-node Tableau Server Environment

Written by
Rate this item
(1 Vote)

image

After a few weeks off, I am delighted to announce that I have returned full time, once again delivering somewhat IT related blog posts, while neatly segueing in thirty-six thousand links to older articles at the same time, in the hope of gaining a few more hits for the internet's least widely-read IT blog.

A couple of weeks ago I was working with a large automotive on implementing a silent installation for a distributed, multi-node Tableau Server environment using LoginVSI Automation Machine in order to increase the scalability of the resulting configuration. By taking advantage of automation, the goal was to establish a powerful and highly-extensible infrastructure for quickly creating and re-deploying Tableau Server environment. With a little effort, it is little surprising how automated your final solution can be.

In a nutshell, the approach to automate the installation of Tableau Server is fairly straight forward and Tableau is kind enough to provide extensive documentation on available command-line arguments as well as Python-based reference scripts for automated deployments. 

Packaging Tableau Server should be *SUPER* easy with Login VSI Automation Machine: in theory, all you need to do is simply importing the Worker Software Setup as well as Tableau Server install source files into the media repository, creating the corresponding packages and adding Run executable action item with appropriate command-line arguments. That's the theory. In reality, the installation experience was somewhat uneven, with the primary node install setup routine sometimes reporting successful installation before all essential background configuration tasks were finished leading to an incorrectly configured and non-functioning installation.

After extensive discussions with Tableau support and some digging on my own, I identified following key factors indicating successful Tableau Server installation and implemented a number of mitigations and remediations:

  • tabsvc service needs to be present
  • "Init: Starting Tableau Server" string is present in C:\ProgramData\Tableau\Tableau Server\logs\tabadmin.log

Armed with this knowledge, I put together following PowerShell script:

# Main code
While (!(Get-Service -Name "tabsvc" -ErrorAction SilentlyContinue)) {
    Write-Host "$(Get-Date -Format HH:mm:ss) - tabsvc not found. Retrying in 30 seconds..."
    Start-Sleep 30
} 

Write-Host "$(Get-Date -Format HH:mm:ss) - tabsvc service detected. Checking tabadmin.log next."

$ready = $false
While ($ready -ne $true) {
    If (Get-Content "C:\ProgramData\Tableau\Tableau Server\logs\tabadmin.log" | Select-String "Init: Starting Tableau Server") {
        Write-Host "$(Get-Date -Format HH:mm:ss) - 'Init: Starting Tableau Server' string detected. Assuming installation is finished."
        $ready = $true
    }
    Else {
        Write-Host "$(Get-Date -Format HH:mm:ss) - Configuration tasks are still running. Waiting for 30 seconds."
        Start-Sleep 30
    }
}

Below is a screenshot of a Tableau Server LoginVSI Automation Machine package which automates installation with a non-default configuration using a YML file, including certificate pre-staging, "run as" user, nodes configuration, and so on.

image

Thanks to Login Automation Machine, I could quickly iterate through numerous versions of the package while striving for the highest quality possible. 

image

Finally, the customer asked to implement a functionality to start Tableau Server after successful installation. Launching the server is easy: all you need to do is run following command:

tabadmin start

As before, theory and reality rarely coincide. Once start procedure initiates, Tableau Server contacts worker nodes and performs initial data store synchronization, so I had to make sure all nodes are up and running before moving on to processing other packages. Without boring you with technical details (for technical mumbo-jumbo, see the PowerShell script attached below), this involved looping through "tabadmin status -v" output until all nodes ended up in status RUNNING.

In conclusion, then, this is the automated installation that gave me the most headaches, literally. And given that I had the whole back catalog of software packages I automated over the years to compare it with, then it must be really, really saying something.

Read 526 times Last modified on Monday, 19 February 2018 11:34
  1. Comments (0)

  2. Add yours
There are no comments posted here yet

Leave your comments

Posting comment as a guest.
0 Characters
Attachments (0 / 3)
Share Your Location

Recent Posts