Tuesday, May 17, 2022

Tableau Issues and Commands

1. Change the hyper.temp_space_timeout to 80% or so and preserve some space on your nodes. 

        tsm configuration set -k hyper.temp_disk_space_limit -v '80%'


2. Update the backgrounder.timeout_tasks to include the Web authoring tasks.

https://help.tableau.com/current/server/en-us/cli_configuration-set_tsm.htm


        tsm configuration set -k backgrounder.timeout_tasks -v "refresh_extracts, increment_extracts, single_subscription_notify, check_data_alert, generate_flow_model, run_flow, encrypt_extracts, decrypt_extracts, rekey_extracts, extract_encryption_maintenance, refresh_extracts_via_bridge, increment_extracts_via_bridge, extract_operations_maintenance, generate_thumbnails, update_metrics_for_view, upgrade_extract_storage, create_extracts_web_auth"


3. Run the following TSM commands to enable in-frame authentication: 

        tsm configuration set -k wgserver.saml.iframed_idp.enabled -v true 

        tsm pending-changes apply


4. 6 tips to make your dashboards more performant https://www.tableau.com/about/blog/2016/1/5-tips-make-your-dashboards-more-performant-48574 5. Optimize Workbook Performance https://onlinehelp.tableau.com/current/pro/desktop/en-us/performance_tips.htm 6. Tableau Workbook Performance Checklist https://onlinehelp.tableau.com/current/pro/desktop/en-us/perf_checklist.htm 7. Designing Efficient Workbooks https://www.tableau.com/learn/whitepapers/designing-efficient

Monday, May 16, 2022

Tableau Linux External File Store Configuration

1. Mount EFS Mount point on all the nodes and provide the user id for tableau run the ownership on the mount. 
2. stop the services using tsm stop 
3. stop Administrative services on all nodes using below command.              /opt/tableau/tableau_server/packages/scripts.2021x.xx.xxxx.x/stop-administrative-services 
4.Contact your infra team to change all tableau user id to same on all servers and change the ownership of files where the old UID and GID is the owner of them. IG GID is 991

     Update UID and GID manually in /etc/passwd and /etc/group file
    find / -group 991 -exec chgrp -h tableau {} \; 
     find / -user 991 -exec chown -h tableau {} \; 
     cd /etc/systemd/system/ 
     cp -p user@.service user@new_gid.service 
     chmod +x user@new_gid.service 
     systemctl enable user@new_gid.service 
5. make sure UID and GID of tableau is updated to new GID 
6. Reboot all nodes. 
7. Start Administrative services. 
        /opt/tableau/tableau_server/packages/scripts.2021x.xxx.xxx/start-administrative-services 
8. This will take long time to start the licensing services.(30 -40 mins) 
9. Run tsm start to start all the services. 
10. Validate once services have been started. check all the extracts running.
11. Stop the services using tsm stop
12. Run the below command to move to EFS 
        tsm topology external-services storage enable –-network-share /mnt/<network share name>/tableau
13. Run tsm start to start all the services. 
14. Validate once services have been started. check all the extracts running.

There will be folders created under the share. 
Extracts and workbook revisions:
tableau_data tabsvc/dataengine/extracts
tableau_data/tabsvc/dataengine/revisions
PostgreSQL data backups:
tableau_data/tabsvc/pg_backups

Tableau Gateway Services Issue.

When Tableau Gateway services are not starting after restart and you see below error in the httpd log use the commands with root access replacing the version of gateway server version. (13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down setcap CAP_NET_BIND_SERVICE=+eip /u01/tableau/data/tabsvc/services/gateway_0.xx.xx.xx/apache/bin/httpd

Thursday, June 17, 2021

Directory File Size on Linux

 To find Mount points size on the servers. : df -k

To find current directory size : du -sh

To find the current subdirectories and file sizes of current directory: du -h

To find the current subdirectories and file sizes of current directory with sort: du -h |sort -h


Chinese charecters

Text Renders As Square Boxes Instead Of Expected Non-English Character



Issue:
A text in a view becomes full of squares after publishing this view to Tableau Server, and the expected characters that were formatted and displayed correctly and nicely in Tableau Desktop can no longer be seen. 

Resolution:
Work with the Server Administrator or your IT team to perform the steps below:
  1. Install NOTO CJK fonts or another font package that contains the missing glyphs
  2. Run [tsm stop] command to shut down Tableau Server.
  3. Reboot Linux OS.
  4. Run [tsm start] command to start up Tableau Server.


Friday, June 12, 2020

Create Users using Tableau API and Python

Create Users using Tableau API and Python

User file will be in the format of userid, roleof the user.

user1,Explorer
user2,Creator
User3,Viewer

import tableauserverclient as TSC
import csv
userfile= open('C:/Users/myartha/Documents/Python Files/users_06112020.csv')
usr = csv.reader(userfile)
sourceusers=[]
createdusers=[]
pat = 'PersonalAccessToken'  #your personal access token created on the UI
server = TSC.Server('<servername>') # provide your server URL
siteid='siteid'   #yoursiteid from the server. This is not the nameof the site but id of the site
tokenName = 'UserGroupScript'  #provide your Token name used when creating personal access Token
server.version='3.6'
ta = TSC.PersonalAccessTokenAuth(token_name=tokenName, personal_access_token=pat, site_id=siteid)
with server.auth.sign_in_with_personal_access_token(ta):
    userlist, pagination_item=server.users.get()
    for user in userlist:
        sourceusers.append(user.name)
    for l in usr:
        targetuser=TSC.UserItem(name=[o],site_role=l[1])
        if targetuser.name in sourceusers:
            print(targetuser.name, "already exits")
        else:
            newgrp = server.users.add(targetuser)
            createdusers.append(targetuser.name)
        print("successfully created groups", createdusers)





Wednesday, May 27, 2020

Create Projects using Tableau API and Python

Creating Tableau Projects and child projects with Tableau API and Python

Prerequisites:

Python on the machine

tableauserverclient module

API enabled on Tableau server.

Permissions to update for the user
Projects.csv file . list all groups in a csv file. attached format .

Changes to be made in the script for below lines in the script
groups = open('<Filepath>/groups.csv')
pat='getyourpersonaltoken'
server = TSC.Server('http://myserver.tableau.com',use_server_version=True)
tokenName = 'mytokenname'


Script:


import tableauserverclient as TSC

import csv


Projects = open('filepath/projects.csv')

prjt = csv.reader(Projects)

projectstobe = list(prjt)

sourceprojects =[]

createdprjts = []

parentproj_id=''

pr_perm = TSC.ProjectItem.ContentPermissions.ManagedByOwner

pat = 'personalaccesstoken'

server = TSC.Server('http://myserver.tableau.com', use_server_version=True)

tokenName = 'mytokenname'

ta = TSC.PersonalAccessTokenAuth(token_name=tokenName, personal_access_token=pat)

with server.auth.sign_in_with_personal_access_token(ta):

   #srcprojects, pagination_item = server.projects.get()

   for projects2 in projectstobe:

       if projects2[3] == 1:

           pr_perm = TSC.ProjectItem.ContentPermissions.LockedToProject

       else:

           pr_perm = TSC.ProjectItem.ContentPermissions.ManagedByOwner

       parentproj=projects2[1]

       endpoint = {

           'project': server.projects,

       }.get('project')

       for resource in TSC.Pager(endpoint.get):

           if parentproj==resource.name:

               parentproj_id=resource.id

       #print(projects2[0],parentproj,parentproj_id)

       new_project = TSC.ProjectItem(name=projects2[0], content_permissions=pr_perm, description=projects2[2],parent_id=parentproj_id)

       new_project = server.projects.create(new_project)

       createdprjts.append(projects2[0])