Coder Social home page Coder Social logo

brilliant-data / palette-director Goto Github PK

View Code? Open in Web Editor NEW
0.0 6.0 0.0 561 KB

Allocate Tableau Workers To Users Or Usage Type

Home Page: http://palette-software.com/

License: GNU General Public License v3.0

CMake 4.91% C 94.86% JavaScript 0.22%
apache tableau tableau-server palette-software

palette-director's Introduction

Building using CMAKE

You'll need an installed apache (with the 'include' folder containing the Apache, APR, and APR-Util exported headers).

Configuring Vizql-Worker-Bindings (httpd.conf)

httpd.conf

After the module is loaded into apache:

LoadModule lbmethod_bybusyness_module modules/mod_palette_director.so

Add the location of the binding configuration file:

WorkerBindingConfigPath "d:/config/workerbinding.conf"
AuthoringBindingConfigPath "d:/config/authoringbinding.conf"
BackgrounderBindingConfigPath "d:/config/backgrounder-binding.conf"

Note: the location of the background is given only for displaying it on the status UI, otherwise this configuration isnt used by the apache module.

Binding config file

The format of the configuration file is identical to the Background Worker Binding Configuration, except for one important detail:

The host names must be the same as they are for the ProxyPass directives in the apache configuration file (httpd.conf). This means that if a host is declared by name (like TABLEAU-PRIMARY1 or tableau-primary.local) then the exact same name must be used in the configuration file. If httpd.conf has an IP for a worker, that IP must be used.

So if your HTTPD conf has the following setup:

<Proxy balancer://A>
	BalancerMember http://qa.local/QA route=QA loadfactor=25
	BalancerMember http://marketing.local/Marketing route=Marketing loadfactor=25
  BalancerMember http://ceo.local/ceo route=ceo loadfactor=25
	BalancerMember http://fallback.local/fallback route=fallback loadfactor=25
	ProxySet stickysession=ROUTEID
</Proxy>

Then the configuration file may look like this:

site,host,binding
Marketing,marketing.local,prefer
Marketing,ceo.local,forbid
QA,qa.local,prefer
QA,ceo.local,forbid
QA,fallback.local,forbid
CEO,ceo.local,prefer
CEO,qa.local,forbid
Default,fallback.local,prefer
CEO,marketing.local,forbid

And if your config has IPs:

<Proxy balancer://A>
	BalancerMember http://192.168.0.2/QA route=QA loadfactor=25
	BalancerMember http://192.168.0.3/Marketing route=Marketing loadfactor=25
  BalancerMember http://192.168.0.4/ceo route=ceo loadfactor=25
	BalancerMember http://192.168.0.1/fallback route=fallback loadfactor=25
	ProxySet stickysession=ROUTEID
</Proxy>

Then the configuration file may look like this:

site,host,binding
Marketing,192.168.0.3,prefer
Marketing,192.168.0.4,forbid
QA,192.168.0.2,prefer
QA,192.168.0.4,forbid
QA,192.168.0.1,forbid
CEO,192.168.0.4,prefer
CEO,192.168.0.2,forbid
Default,192.168.0.1,prefer
CEO,192.168.0.3,forbid

Status page

To allow the module to serve status pages, add the palette-director-status handler to a suitable location:

<Location /palette-director-status>
  SetHandler palette-director-status
</Location>

After a restart, the status page will be available under:

http://localhost/worker-bindings

Different formatted versions are available:

  • http://localhost/worker-bindings is the full-featured version

  • http://localhost/worker-bindings/html is the plain HTML (without the CSS file linked, so it can be simply loaded into the serverstatus document)

  • http://localhost/worker-bindings/json is the JSON version if further processing of the status is needed.

Inserting the status page into the tableau Cluster Status page:

To inject the HTML output of the "Worker Bindings Status Page" endpoint into the Status Page of the Tableau Server, you'll need to add the javascript/director-status-fetcher.js to the list of loaded JS files on the Tableau Server.

If editing the HTML template is not possible, then a workaround is editing the vizPortal.js javascript file and adding the following snippet to the end:

$.get('/palette-director-status/html', null, function(result){
    $('.tb-scroll.tb-scroll-settings .tb-settings-section:nth-child(1)').after(result);
});

Both of these approaches try to insert the worker binding statuses after the current cluster status table.

Development notes

Building

Windows

You'll need a 32 bit Visual Studio 2010 to compile modules for the apache supplied with Tableau

  • Put the (32 bit) apache installation anywhere on your machine

  • set the APACHE_INCLUDE_DIR CMake cache variable to the include directory of that installation

  • set the APR_INCLUDE_DIR CMake cache variable to the include directory of APR utility library

  • set the APACHE_LIB_DIR CMake cache variable to the lib directory of that installation

  • The CPack installer needs attention to make it work

Ubuntu

On a fresh Ubuntu you'll need the apache2-dev and cmake packages. (APR is installed as a dependency of the apache2-dev package.)

# Install dependencies
sudo apt-get install apache2-dev cmake

# Create a build directory in /tmp
mkdir /tmp/palette-director-build

# Go to the build directory
cd /tmp/palette-director-build

# Create the makefile using the default location of the apache2-dev package
cmake <SOURCE_DIR> -DAPACHE_INCLUDE_DIR=/usr/include/apache2 -DAPR_INCLUDE_DIR=/usr/include/apr-1.0

# Run the build
make

Other UNIX variants should also work, but the package manager usage and the default install locations may differ from Ubuntu. Please consult the documentation of your package manager for details.

OSX

For developing on OSX you'll need to manually download a source release of Apache and APR (along with APR-utils), but everything else should work just like on Ubuntu.

Code format

All code in the repository is formatted by clang-format with the settings checked in as .clang-format so running

clang-format -i src/*.{c,h}

should format all your code for the coding standards of the project.

palette-director's People

Contributors

adambalazs avatar gyulalaszlo avatar horvathg avatar tfoldi avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.