Skip to Content

Multi Tenant

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Aug 22, 2018 at 08:32 AM

    : 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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.