<< Back

Basic Tableau Server tasks with the new TSM Command Line

As you may already know, in the new Tableau Server version 2018.2 there are some changes in the way Tableau Server Administrators manage the server with the introduction of the Tableau Services Manager (TSM).

One of this changes is the replacement of the tabadmin Command Line by the new TSM Command Line. So maybe you want now to perform some of those basic tasks like creating backups, grant access to the server repository, create ziplogs, or change your Tableau Server header logo and you that you are used to run quite frequently and now you are not sure about how to do those.

For this reason, in this post I will talk about some of the most frequently used Tableau Server Admin tasks we used to do with the tabadmin Command Line and how we can do those same ones with the new TSM Command Line. Just to clarify, this is not intended to be an overview of all the commands and options available for each command, but a quick resume of some of the most common tasks we see with our customers. This will also assume you are familiar with running Tableau Server commands in the Command Prompt. Lets start!

Apply any pending configuration changes

One of the most important commands, as it will allow us to apply any pending configuration and topology changes we have written and restart the Server if necessary. The command is:

tsm pending-changes apply

Then a prompt will warn you that the command will restart Tableau Server. You can type y to confirm you want to restart the Server and the pending configuration changes will be applied. If you want to avoid the prompt restart warning you can include an option to do so, but the restart will still happen:

tsm pending-changes apply --ignore-prompt

Change sign-in and header logos

You want to change the sign-in and header logos? then these are the commands to use.
To  change the header logo for an image specify in a concrete path, use:
tsm customize --header-logo <path>

To change the sign-in logo for an image specify in a concrete path use:

tsm customize --signin-logo <path>

You can also change both the header logo and the sign-in logo with one command:

tsm customize --logo <path>

And reset all customizations to default:

tsm customize --restore-defaults

Remember for the first three cases to replace the <path> by the full path and file name of the logo you want to use.

Enable data repository access

You have probably heard about all the data and insightful dashboards you can build with the repository database. If you want to enable access to the repository using the TSM, this is the command to use:

tsm data-access repository-access enable --repository-username <username> --repository-password <password>

You will need to replace <username> by tableau or readonly (the two available users) and <password> for the password you want to give to that user. Additionally, you can add at the end the option –restart to supress the prompt for restart Tableau Server and restart it automatically.

Finally, if you want to disable access to the repository for a concrete user, you can use the command:

tsm data-access repository-access disable --repository-username <username>

Configure Data Caching

Probably you remember the caching options available in the Data Connections tab of the Tableau Server Configuration window on previous versions. Now, if you want to change the caching options you can do it using the following command:

tsm data-access caching set --refresh-frequency <value>

You will need to replace <value> by one of the following options:
  • low to cache and reuse data for as long as possible (this is the default value).
  • always to refresh data each time a page is loaded.
  • 30 or other numerical value to define the maximum number of minutes data should be cached.

Backup the server and restore from previous backups, cleanup and create ziplogs

Perform current backups of the server is one of the most important maintenance tasks to perform on or Tableau Server. How we do each of this with the new TSM command line?
To create a backup that includes the repository database, workbooks and user metadata, extract files and configuration data we can execute the following command:

tsm maintenance backup --file <file>

Remember to replace <file> with the directory and file name you want to save it to. Additionally, you can add optional parameters like:
  • -d or -append-date to append the current date to the backup file name. By default, the location is  /var/opt/tableau/tableau_server/data/tabsvc/files/backups/
  • -k or –skip-verification to nor verify the integrity of the database backup.
If what we want to do is to restore the Server from a backup previously made, the command to introduce in the command line is:

tsm maintenance restore --file <filename> --restart-server

Replacing the <filename> by the file path and name where the backup is located. If we don’t specify a path when creating the backup, then we can just write the filename and not the full path, as Tableau will use the default one. We can also replace –restart-server by -r to restart the server if we want to save some typing.

Cleanup files and create ziplogs

Using the maintenance command we can also cleanup old files and create ziplogs.  How? Lets have a look:

To cleanup all possible files old and temporary files we can use the command:

tsm maintenance cleanup -all

But if you want to specify the files to clean, you can replace the -all option by one or more than one of the following:
  • -l to delete log files older than 24 hours. If you want delete log files older than another number of days, you can add also the option –log-files-retention <#days> replacing <#days> by the number of days you want to retain. For example: tsm maintenance clenaup -l –log-files-retention 10 this will delete all log files except the ones for the last 10 days.
  • -q to delete old http_requests table entries.
  • -r to clear the cache.
  • -t to delete temporary files.
So at the end, if we executing the command:

tsm maintenance cleanup -all

Is equivalent to this one:

tsm maintenance cleanup -l -q -r -t

Finally, to create an archive of log files, the command to use is:

tsm maintenance ziplogs -all

This will create an archive with all logs except PostgreSQL data. We can replace the -all by -d to include the PostgreSQL data folder but we will need to stop the server first so all the data is included. We can also add the option -f <file> replacing <file> for the name and path where we want to save the log files archive.

Start, stop and restart the server

These are very easy one. To start the server, the command to use is:

tsm start

If we want to stop the server, then:

tsm stop

And to restart the server:

tsm restart

Check the status of the server

Of course, we can use the web UI to check the status of the server, but if we want to use the command line what we will need to type is:
tsm status

We can include the option -v or -verbose at the end to display the status for every node in a cluster environment.

Where to find additional information and commands?

These are some of the most common tasks we can perform with the new TSM command line. But as I said at the beginning my intention wasn’t to write about all the different options available. You can always check the tsm Command Line Reference website (https://onlinehelp.tableau.com/current/server-linux/en-us/tsm.htm) if you need full details of all the different options or more advance tasks like the ones available with the tsm configuration set command.

Additionally, you can use this command to get a list of all the commands available:

tsm help commands

Or even get more information and help for a concrete command using the structure tsm help <command>, for example:

tsm help customize

Will give us additional information about the customize command.

Leave a Reply

Your email address will not be published. Required fields are marked *