Setting up MultiTenancy

MultiTenancy allows a company the ability to instantiate different organizations within one entity. For example say your organization is called Acme and inside of Acme there are two divisions AcmeTraders and AcmeInsurance and each organization is not allowe to see one another's owlcheck results. You would simple segregate them into 2 different Tenants within the overarching Owl web application.

Prereqs = A DNS entry for each tenant and your main schema hub.

  • DNS entry for owl web server IP = example below we call it hub

  • DNS entry for multiTenantSchemaHub = example below we call it owlhub.hub

  • DNS entry for every tenant you want to create = example below we call it tenant1.hub

Each record above points to the same IP address.

In order to setup multi-tenancy follow these steps

  • If this is an upgrade please make sure to follow the steps outlined in the "Upgrading to latest Version"

  • Make sure the web application has started up one time and you successfully logged into it with the default credentials.

  • Then stop all the components using ./owlmanage.sh stop

  • Modify the owl-env.sh file to include these to new parameters

    1. export multiTenantSchemaHub=owlhub (this is a new schema that will get created on owlweb start, note the name of the TenantSchemaHub can be changed to the desired name at setup time)

    2. export MULTITENANTMODE=TRUE (this enabled multi-tenancy to be used).

  • If using agents as part of the operation of owl please be sure to modify the owl.properties file to include the following.

    1. spring.agent.datasource.url=jdbc:postgresql://cdh-edge-dan.us-east4-c.c.owl-hadoop-cdh.internal:5432/postgres?currentSchema=owlhub (matching the name of the schema set on step 3-1 above).

    2. jdbc:postgresql://cdh-edge-dan.us-east4-c.c.owl-hadoop-cdh.internal:5432/postgres?currentSchema=owlhub (matching the name of the schema set on step 3-1 above).

  • Once the settings have been configured for multi-tenancy please start up the owlweb host first using ./owlmanage.sh start=owlweb. Once the web is up and you can hit the page please start up the agents using ./owlmanage.sh start=owlagent.

  • In order to use multi-tenancy you'll have to make sure we have DNS entries to the tenant endpoints. Example:

    1. If I have a DNS alias named hub. I should be able to point me browser at hub:9002 (or your respective owlweb port) to get to the main Multi-Tenant login page as depicted below

  • This is where DNS alias come into place. Assuming we left the owlhub as the multiTenantSchemaHub name we hit the drop down and select owlhub and click the arrow it will place owlhub.hub into the url. This means there also has to be a DNS Alias name for your selected multiTenantSchemaHub name. NOTE: Username and password for tenant management is mtadmin / mtadmin123

  • Now that you logged into the Tenant Management screen using the hub DNS alias we can create our first tenant. In this example below I'm going to create a tenant named tenant1. First click the "+ Add Tenant" button in the top right part of the screen.

Click Save. Your tenant shows up in the list and now you can click the login button as shown below.

Clicking the Login button will redirect your browser to the tenant1.hub:9002 url (DNS entry needs to be in place for tenant1 as shown below).

Enter the admin username and password that you created for the tenant1 (refer to figure 3 about) and login to the tenant as the admin.

While logged in as a tenant admin the last step is to go to the Admin Console and click on "Sync Schema" this will generate the tables under the tenant called tenant1.

At this point you are ready to start administrating your tenant1 as you did with the owl web application in the past.

Last updated