Tableau Server Maintenance Page in Conjunction with IIS

Version 1

    There is a built in maintenance page within the Tableau Server environment. This is access by navigating to "Root:\ProgramData\Tableau\Tableau Server\data\tabsvc\httpd\htdocs and creating the "system" folder. Inside the system folder, creating the file "maintenance.html" will put tableau server into maintenance mode. While this is an intriguing feature of Tableau Server, the maintenance page is only available while the server is up and running (Specifically the Tableau Server Application Manager: tabsvc service) which severely limits what type of maintenance is available to be done.

     

    An alternative solution is to utilize IIS in conjunction with the tableau maintenance page to minimize user interruption. In essence, this approach 'hot swaps' the tableau maintenance page with a maintenance page of your choice or redirects the url to another server.

     

    Important Notes:

    1. This is an experimental solution that we are trying out and is not endorsed by Tableau. fine print, yada yada yada

    2. The IIS Service should be set to Manual (W3svc) otherwise when Tableau Server restarts, the IIS Service will start before Tableau Server can pick up the default port. In our case, we prefer Tableau Server to start automatically in case of a restart and not going directly into maintenance mode

    3. There are still downtimes where the end users will experience a down time (no maintenance page or sign in page) in between the tabsvc service and the W3svc services are switching between ports. In our last upgrade, there was a brief 29 second pause when the service tabsvc still had the port but once that service stopped the IIS picked up the thread and was up throughout the upgrade. For the Deactivate_Maintenance Script, we had a 7 second pause between switching from IIS to tabsvc.

    4. If you are doing configuration changes or an upgrade, you may receive a notification stating that the gateway port could not be reached (which is anticipated since the IIS is using the default port). The error should not be a hard stop but more of a notification and allow you to continue, however I did have one time where I had to stop the W3svc service for a minute so the Configuration Page could access the default port.

    5. The purpose of doing this is during a long upgrade or maintenance, the end users do not receive an error stating the page could not be reached. We are experimenting with redirecting to a restored non-prod server that sets everyone automatically to view only (essentially a read only server) but are checking on the licensing with Tableau if that would constitute having multiple 'Prod' servers. In using this approach the end users still have access to data and limited functionality. We would also recommend scripting an update to the sign in page and header to indicate the server is under maintenance (or in a non-prod environment).

     

    PowerShell Scripts are attached below

     

    To activate IIS on your server:

     

    1. Navigate to Server Manager

     

     

    2. Add Roles and Features> Roel Based or Feature-Based Installation

    3. Scroll down to Web Server (IIS) and check box (Next, Next, Finish)

    4. After this finishes installing (may require a reboot), IIS will now be an option on the Server Manager Dashboard

    5. Connect to the IIS Manager (Internet Information Services (IIS) Manager)

    6. You are able to use the "Default Web Site" if you would like and configure the "C:\inetpub\wwwroot\iisstart.htm" file with your own html information. You are also able to create your own Application Pool and Site. In this example I have create the Application Pool "Tableau Server Mainteance" and a Site "Tableau Server Maintenance" but using the default location to avoid permission issues.

    7. In the Sites Area, you are able to configure the default port (if using port 80 or 443) as well as choosing a HTTP Redirect (If redirecting to another 'View Only' server while the upgrades occur).

    *Note, you will not be able to start the Site at this time as the port is currently being utilized by Tableau Server

     

    8. In order to take Tableau Server Down, we will first need to Activate the Tableau built in maintenance page, then start the different services required to initiate IIS, stop the Tabsvc service to release the default port, activate the website to pick up the dropped port, and then stop tableau server.

     

    Here is the current script that we are using:

     

    Activate_Maintenance.ps1 (Powershell)

    ######################################################
    #                    This Script                    #
    #  Activates the Maintenance Page on Tableau Server #
    #  via IIS and httpd and stops Tableau Server        #
    ######################################################

    #Directory for Tabadmin if not already mapped to Command Prompt, Note* will script this later to find latest version
    $directory = "C:\Program Files\Tableau\Tableau Server\10.5\bin"

    #Activates the Tableau Maintenance Page, this immediately has all traffic go to the maintenance page instead of the Tableau screen

    Rename-Item -Path "C:\ProgramData\Tableau\Tableau Server\data\tabsvc\httpd\htdocs\system\maintenance_deactivated.html" -NewName "C:\ProgramData\Tableau\Tableau Server\data\tabsvc\httpd\htdocs\system\maintenance.html"

    #Sets tabsvc service (Tableau Server Application Manager) startup type to manual since it may automatically come back on

    Set-Service -Name "tabsvc" -StartupType Manual

    #Starts the w3svc service (World Wide Web Publishing Service) for IIS to replace tabsvc
    Start-Service -Name "W3svc"

    #Starts the WebAppPool for Tableau Server Maintenance Page for IIS
    Start-WebAppPool -Name "Tableau Server Maintenance"

    #Starts the Website Tableau Server Maintenance for IIS, will result in an error since the port is still being held by tabsvc but 'warms up' the app
    Start-WebSite -Name "Tableau Server Maintenance"

    #Stops the tabsvc service (Tableau Server Application Manager) to bring down tableau webpage, this will result in a brief pause while the service is stopping and will show an update until the service is stopped
    Stop-Service -Name "tabsvc"

    #Starts the Website Tableau Server Maintenance for IIS, port is now released and will switch over to the Maintenance Page

    Start-WebSite -Name "Tableau Server Maintenance"

    #Finishes Stopping Tableau Server
    cd $directory
    .\tabadmin.bat stop

     

    And then to Deactivate_Maintenance we do the reverse.

    De-Activate_Maintenance.ps1 (Powershell)

    ######################################################
    #                     This Script                    #
    # DeActivates the Maintenance Page on Tableau Server #
    #      via IIS and httpd and starts Tableau Server   #
    ######################################################

    #Directory for Tabadmin if not already mapped to Command Prompt, Note* will script this later to find latest version
    $directory = "C:\Program Files\Tableau\Tableau Server\2018.1\bin"

    #Starts Tableau Server, IIS still active at this point so Gateway will not come up
    cd $directory
    .\tabadmin.bat start

    #Stops the IIS WebSite, then WebApp, brief pause until tabsvc comes back up
    Stop-WebSite -Name "Tableau Server Maintenance"
    Stop-WebAppPool -Name "Tableau Server Maintenance"

    #Sets tabsvc to automatic
    Set-Service -Name "tabsvc" -StartupType Automatic

    #Stops the IIS to completely release port
    Stop-Service -Name W3svc

    #Starts tabsvc to bring up Tableau's maintenance Page

    Start-Service -Name "tabsvc"

    #Tabadmin Start to make sure everything came up properly

    cd $directory
    .\tabadmin.bat start

    #Removes Tableau's maintenance page and sets it to deactivated, will restore normal functionality in Tableau

    Rename-Item -Path "C:\ProgramData\Tableau\Tableau Server\data\tabsvc\httpd\htdocs\system\maintenance.html" -NewName "C:\ProgramData\Tableau\Tableau Server\data\tabsvc\httpd\htdocs\system\maintenance_deactivated.html"