how to implement Multi-Schema Multi-Tenancy in alfresco ?

cancel
Showing results for 
Search instead for 
Did you mean: 
medhedhili
Active Member

how to implement Multi-Schema Multi-Tenancy in alfresco ?

I need to implement Multi-Schema Multi-Tenancy in alfresco 

 

Any guidance will be helpful !

11 Replies
ryandawson
Alfresco Employee

Re: how to implement Multi-Schema Multi-Tenancy in alfresco ?

I guess you mean Alfresco Process Services? If so have you looked at Multi-schema multi-tenancy (MS-MT) | Alfresco Documentation  and the links at the bottom of that page?

medhedhili
Active Member

Re: how to implement Multi-Schema Multi-Tenancy in alfresco ?

The official documentation is not detailed I would like to have an example of installation multi-tenant license and also I want to know how to launch a requette Rest to create a tenant

ryandawson
Alfresco Employee

Re: how to  implement Multi-Schema Multi-Tenancy in alfresco   ?

Have you looked at the getting started link at the bottom (it is a bit hidden) - Getting started with MS-MT | Alfresco Documentation  ?

I take it you are an enterprise customer? I don't have more detailed documentation to hand but as an enterprise customer you can raise an official support request.

medhedhili
Active Member

Re: how to  implement Multi-Schema Multi-Tenancy in alfresco   ?

No, I am a student engineer as part of my end of studies project I want to know how to implement the MS-MT in alfresco. Well I looked at the example of Getting started but for example the property tenancy.model = isolated one put it in which file and how to configure the primary database?

ryandawson
Alfresco Employee

Re: how to implement Multi-Schema Multi-Tenancy in alfresco ?

Ok I can share some more detailed steps that I've been able to obtain.

The tenancy.model=isolated is in activiti-app.properties

You're going to want to connect directly to the database to do this so you're going to need a database tool and the right level of access. For mysql you can create a user using e.g.

CREATE USER 'alfresco'@'localhost' IDENTIFIED BY 'password';

To create a primary database:

CREATE DATABASE primary_db
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;
GRANT ALL ON primary_db.* TO 'alfresco'@'localhost';

If you want to create two tenants, you need to create two secondary databases:

CREATE DATABASE db_tenant_a
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;
GRANT ALL ON db_tenant_a.* TO 'alfresco'@'localhost';

CREATE DATABASE db_tenant_b
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;
GRANT ALL ON db_tenant_b.* TO 'alfresco'@'localhost';


Then you can create the tenants via the API (this API will populate the tenant database with the corresponding tables)

a. POST http://localhost:9999/activiti-app/api/enterprise/admin/tenants
{
"name" : "db_tenant_a",
"configuration" : "tenant.admin.email=admin@db_tenant_a.com\n datasource.driver=com.mysql.jdbc.Driver\n datasource.url=jdbc:mysql://127.0.0.1:3306/db_tenant_a?characterEncoding=UTF-8\n datasource.username=alfresco\n datasource.password=password"
}
b. POST http://localhost:9999/activiti-app/api/enterprise/admin/tenants
{
"name" : "db_tenant_b",
"configuration" : "tenant.admin.email=admin@db_tenant_b.com\n datasource.driver=com.mysql.jdbc.Driver\n datasource.url=jdbc:mysql://127.0.0.1:3306/db_tenant_b?characterEncoding=UTF-8\n datasource.username=alfresco\n datasource.password=password"
}

Then you should be able to Log in with tenant admin for each tenant using  admin@app.activiti.com and user's passord
db_tenant_b: admin@db_tenant_b.com
!Note: Do not use admin@app.activiti.com to create users inside the tenants, only tenant admins should create users


You can then create users using tenant admin and login with those users and create new models: processes, app and try running them

medhedhili
Active Member

Re: how to implement Multi-Schema Multi-Tenancy in alfresco ?


I didn't find the file  activiti-app.properties . is it me that will create the file, if yes. where do I want to create the file?

ryandawson
Alfresco Employee

Re: how to  implement Multi-Schema Multi-Tenancy in alfresco   ?

There should be a file with default values on your server - see Configuring Alfresco Process Services | Alfresco Documentation 

medhedhili
Active Member

Re: how to implement Multi-Schema Multi-Tenancy in alfresco ?

if activiti-app.properties does not exist in the path specified in the official documentation then I will create the file and configure it or what?

ryandawson
Alfresco Employee

Re: how to implement Multi-Schema Multi-Tenancy in alfresco ?

Are you definitely using the same product and version as that documentation page?