5 Replies Latest reply on Oct 4, 2013 10:50 AM by Toby Erkson

    Remotely backing up server

    Russell Miller

      This is probably a simple one, but, I need to ask it anyway:

       

      I'm attempting to schedule a backup of our tableau servers. The script will run from our batch scheduler (Tidal) and use powershell to run a batch script on the 'remote' tableau server.

       

      The PS call (with server/user names changed to protect the innocent):

      Invoke-Command - ComputerName <TABLEAUSERVER> -ScriptBlock {E:; ./TableauBackup.cmd "E:\Tableau Backups\testPSRemote.bak" -Credentials <USER>

       

      The script, TableauBackup.cmd, is exceedingly simple:

      tabadmin stop

      tabadmin backup %1

      tabadmin start

      tabadmin warmup

       

       

      If I log into the server using the credentials for <USER> and run the command file from the command line, all is well. Everything works like it should and comes right back up.

       

      However, when I run it remotely via Powershell and use the same user, The tabadmin stop works, and it backup begins, but, it fails after attempting to clean the http_request entries from the database.

       

      I get the following error:

      *** The driver encountered an unknown error: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.

       

      It promptly then shuts down all components. After that the tabadmin start command attempts to run and I get an error that the FlexNet Library could not be initialized. I'm guessing this is a result of the backup choking.

       

      After all of this, I can log into the server and run tabadmin start and all is well.

       

      Any help would be appreciated.

        • 1. Re: Remotely backing up server
          Russell Miller

          I've been poking around at this for a while now and I'm getting varied errors while trying to run the 'tabadmin backup' command remotely via powershell.

           

          The heart of the matter, however seems to be that the JVM is running out of memory. Tableau is spitting out an error log file and the contents (limited to the first several lines) look like this:

           

          #

          # There is insufficient memory for the Java Runtime Environment to continue.

          # Native memory allocation (malloc) failed to allocate 32756 bytes for ChunkPool::allocate

          # Possible reasons:

          #   The system is out of physical RAM or swap space

          #   In 32 bit mode, the process size limit was hit

          # Possible solutions:

          #   Reduce memory load on the system

          #   Increase physical memory or swap space

          #   Check if swap backing store is full

          #   Use 64 bit Java on a 64 bit OS

          #   Decrease Java heap size (-Xmx/-Xms)

          #   Decrease number of Java threads

          #   Decrease Java thread stack sizes (-Xss)

          #   Set larger code cache with -XX:ReservedCodeCacheSize=

          # This output file may be truncated or incomplete.

          #

          #  Out of Memory Error (allocation.cpp:222), pid=5680, tid=1924

          #

          # JRE version: 7.0_13-b20

          # Java VM: Java HotSpot(TM) Client VM (23.7-b01 mixed mode windows-x86 )

          # Failed to write core dump.

          #

           

           

          Maybe this will help spark the conversation.

           

          The Tableau Server is a 4CPU 8GB VM.

          • 2. Re: Remotely backing up server
            Toby Erkson

            Contact support.  I had an issue back in version 7 and it turned out I needed to increase my Java heap size, something I never would've ever guessed nor find in the documentation.  Support gave me a very simple command line fix.  So give them a shot if you don't get an answer here.

            • 3. Re: Remotely backing up server
              Toby Erkson

              Oh, and when you get this figured out, please let us know what the fix was.  Thanks

              • 4. Re: Remotely backing up server
                Russell Miller

                Closer, closer, closer....

                 

                The original issue is that the remote powershell session, by default, only gets 150 MB to play with. This is clearly far too little to do anything but shut the Tableau service down.

                 

                After running the command Set-Item WSMan:\localhost\Shell\MaxMemoryPerShellMB 2048 on the tableau server, I can run a stop and backup without issue.

                 

                However (and this is the catch), when I try to start Tableau using 'tabadmin start', I receive the error

                 

                *** com.tableausoftware.license.dll.SetupException: FlexNet Library could not be initialized, error code 21. FLEXnet

                Licensing Service is not started.

                 

                This is, of course, a lie. The FlexNet service is running it's tail off and not bothering anyone. The PS Session and the admin user running it just can't see it/figure it out.

                 

                It should be apparent to everyone at this point that Microsoft has so severely hampered the poor remote Powershell session that the poor guy just wants to lie down in a great grassy field with his fellow fallen script command(oe)s and die.

                 

                At this point, I'm going to fall back to just using Windows Scheduler...

                 

                Here's hoping that 8.1's tabadmin will grant a pardon to the remote Powershell session's death sentence. Until that time, feel free to use him as a party favor to randomly shutdown your favorite Tableau Jedi's local server. Enjoy!

                • 5. Re: Remotely backing up server
                  Toby Erkson

                  Russell, thanks for posting!  I'm familiar with DOS but not PowerShell...but I want to learn it.  It's good to know this info because if I tried I'd be hopelessly lost.

                   

                  BTW, here's my batch file I created for my backups (last post by me) --> http://community.tableau.com/message/199064#199064

                  I am using Windows Scheduler to run my backups locally.