cancel
Showing results for 
Search instead for 
Did you mean: 

Multi Tenant

former_member630291
Participant
0 Kudos

Hi Experts,

Is it possible to run a multi tenant hybris instance in local system with the bundled HSQL DB in SAP Hybris?

If yes, 1. can you please tell us what DB configurations would be required? 2. Do we need to initialize all the tenants? 3. Can we have run all the tenants at a time? Say for ex: One master and 3 slaves

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member618655
Active Participant
0 Kudos

: yes Ashish, you can run multi-tenants all at the same time, if you are using oracle, create 3 schemas for your slave tenants. If you are using MySQL create 3 databases one for each tenant.

I suggest using MySQL because it is free. Download MySQL and create 3 Databases. Each database will have a unique URL For example your 3 database URLs might be:

jdbc:mysql://localhost:3306/db1?useConfigs=maxPerformance&characterEncoding=utf8
jdbc:mysql://localhost:3306/db2?useConfigs=maxPerformance&characterEncoding=utf8
jdbc:mysql://localhost:3306/db3?useConfigs=maxPerformance&characterEncoding=utf8

Here, db1, db2 and db3 are your DB instance names.

In your local.properties file, update a property called installed.tenants=t1,t2,t3 where t1, t2 and t3 are your tenants.

Create 3 files in the same directory where your local.property file resides. these files will be local_tenant_t1.properties
local_tenant_t2.properties
local_tenant_t3.properties

in each file, put db.url from the list of DB urls I provided above. so db.url in local_tenant_t1 will be jdbc:mysql://localhost:3306/db1?useConfigs=maxPerformance&characterEncoding=utf8

Similarly update your other tenant specific property files.

Keep master tenant running on HSQL DB. Now go to, https://localhost:9002/hac and you will see your tenants, make sure you initialize all tenants. One all tenants are initialized, go to your MySQL to see if you see Hybris specific tables.

For tenant t1 and ProductModel, you will a table name t1_products. This is because by default hybris appends tenant name in front of table. To remove this, add a property called db.tableprefix in all your tenant files and keep it blank.

former_member630291
Participant
0 Kudos

Hi Saurav,

Thanks for writing in.

But I wasn't looking for this.

My question was: is it possible to run 4 tenants (1 master and 3 slaves) in HSQLDB prebundled with SAP Hybris.

former_member618655
Active Participant
0 Kudos

Yes. However, you have to configure 4 instances. one for master and one for each tenant. We do the same thing on our local machines.