multi tenant setup help

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

multi tenant setup help

Rajesh Mallah
Hi ,

I am trying to setup/configure ofbiz with multi tenant feature
i am following the doc

https://cwiki.apache.org/confluence/display/OFBIZ/Multitenancy+support

there are 2 gradle tasks related to tenants

createTenant - Create a new tenant in your environment
loadTenant - Load data using tenantId

however they are not referenced in that doc . More over the
docs refer to ant and the commands eg:


java -Xmx512m -XX:MaxPermSize=128m -jar ./build/libs/ofbiz.jar -install
-readers=seed,seed-initial,ext -delegator=default
does not really work.


could someone please point to some references that would help.

particularly i have done till below


   - OFBIZ-HOME/framework/entity/data/<yourTenantConfig>.xml
   - OFBIZ-HOME/framework/entity/config/entityengine.xml
   - OFBIZ-HOME/framework/entity/ofbiz-component.xml

and i ran
 ./gradlew "ofbiz --load-data readers=seed,seed-initial,ext "

in ofbiz-component i have :

    <entity-resource type="data"  reader-name="ext" loader="main"
location="data/TenantDemoData.xml"/>

TenantDemoData.xml
=================

<?xml version="1.0" encoding="UTF-8" ?>
<entity-engine-xml>
<Tenant tenantId="TENANT-A" tenantName="Tenant A"/>
<TenantDataSource tenantId="TENANT-A" entityGroupName="org.apache.ofbiz"
jdbcUri="jdbc:postgresql://postgresql/tenant_a_db"
jdbcUsername="ofbiz_cust_a" jdbcPassword="xxxxxxxxxxxx"/>
<TenantDataSource tenantId="TENANT-A"
entityGroupName="org.apache.ofbiz.olap"
jdbcUri="jdbc:postgresql://postgresql/tenant_a_db"
jdbcUsername="ofbiz_cust_a" jdbcPassword="xxxxxxxxxxxx"/>
</entity-engine-xml>

===========================

entityengine.xml
=============================

  <delegator name="default" entity-model-reader="main"
entity-group-reader="main" entity-eca-reader="main"
distributed-cache-clear-enabled="false">
        <group-map group-name="org.apache.ofbiz"
datasource-name="localpostgres"/>
        <group-map group-name="org.apache.ofbiz.olap"
datasource-name="localpostolap"/>
        <group-map group-name="org.apache.ofbiz.tenant"
datasource-name="localposttenant"/>
    </delegator>
    <delegator name="default-no-eca" entity-model-reader="main"
entity-group-reader="main" entity-eca-reader="main"
entity-eca-enabled="false" distributed-cache-clear-enabled="false">
        <group-map group-name="org.apache.ofbiz"
datasource-name="localpostgres"/>
        <group-map group-name="org.apache.ofbiz.olap"
datasource-name="localpostolap"/>
        <group-map group-name="org.apache.ofbiz.tenant"
datasource-name="localposttenant"/>
    </delegator>

    <!-- be sure that your default delegator (or the one you use) uses the
same datasource for test. You must run "gradlew loadDefault" before running
"gradlew testIntegration" -->
    <delegator name="test" entity-model-reader="main"
entity-group-reader="main" entity-eca-reader="main">
        <group-map group-name="org.apache.ofbiz"
datasource-name="localpostgres"/>
        <group-map group-name="org.apache.ofbiz.olap"
datasource-name="localpostolap"/>
        <group-map group-name="org.apache.ofbiz.tenant"
datasource-name="localposttenant"/>
    </delegator>
========================================================


what is next?




regds
rajesh kr mallah.
Reply | Threaded
Open this post in threaded view
|

Re: multi tenant setup help

taher
Hello Rajesh,

Did you try the README.md? It should be pretty comprehensive. Also,
try to understand the overall design. Ignore for a second the syntax
and think of the design of multi tenancy. You have the following
databases:

1- The OFBiz standard single tenant instance (ofbiz)
2- A master database for all tenants (ofbizTenant)
3- A database per tenant.

When you call the command createTenant, you essentially load that
tenant's information into the tenants master database AND you also
create a new database specific to that tenant.

The main differentiation between the tenants is the delegator name.
The default database has the delegator "delegator". Every tenant has a
database with a delegator called "delegator#TenantIdHere"

So, when loading specific data like seed, for a specific tenant, then
you need to pass both the readers AND the correct delegator.

I hope this helps and that I understood and answered your question
appropriately.

On Sat, Mar 10, 2018 at 9:29 PM, Rajesh Mallah <[hidden email]> wrote:

> Hi ,
>
> I am trying to setup/configure ofbiz with multi tenant feature
> i am following the doc
>
> https://cwiki.apache.org/confluence/display/OFBIZ/Multitenancy+support
>
> there are 2 gradle tasks related to tenants
>
> createTenant - Create a new tenant in your environment
> loadTenant - Load data using tenantId
>
> however they are not referenced in that doc . More over the
> docs refer to ant and the commands eg:
>
>
> java -Xmx512m -XX:MaxPermSize=128m -jar ./build/libs/ofbiz.jar -install
> -readers=seed,seed-initial,ext -delegator=default
> does not really work.
>
>
> could someone please point to some references that would help.
>
> particularly i have done till below
>
>
>    - OFBIZ-HOME/framework/entity/data/<yourTenantConfig>.xml
>    - OFBIZ-HOME/framework/entity/config/entityengine.xml
>    - OFBIZ-HOME/framework/entity/ofbiz-component.xml
>
> and i ran
>  ./gradlew "ofbiz --load-data readers=seed,seed-initial,ext "
>
> in ofbiz-component i have :
>
>     <entity-resource type="data"  reader-name="ext" loader="main"
> location="data/TenantDemoData.xml"/>
>
> TenantDemoData.xml
> =================
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <entity-engine-xml>
> <Tenant tenantId="TENANT-A" tenantName="Tenant A"/>
> <TenantDataSource tenantId="TENANT-A" entityGroupName="org.apache.ofbiz"
> jdbcUri="jdbc:postgresql://postgresql/tenant_a_db"
> jdbcUsername="ofbiz_cust_a" jdbcPassword="xxxxxxxxxxxx"/>
> <TenantDataSource tenantId="TENANT-A"
> entityGroupName="org.apache.ofbiz.olap"
> jdbcUri="jdbc:postgresql://postgresql/tenant_a_db"
> jdbcUsername="ofbiz_cust_a" jdbcPassword="xxxxxxxxxxxx"/>
> </entity-engine-xml>
>
> ===========================
>
> entityengine.xml
> =============================
>
>   <delegator name="default" entity-model-reader="main"
> entity-group-reader="main" entity-eca-reader="main"
> distributed-cache-clear-enabled="false">
>         <group-map group-name="org.apache.ofbiz"
> datasource-name="localpostgres"/>
>         <group-map group-name="org.apache.ofbiz.olap"
> datasource-name="localpostolap"/>
>         <group-map group-name="org.apache.ofbiz.tenant"
> datasource-name="localposttenant"/>
>     </delegator>
>     <delegator name="default-no-eca" entity-model-reader="main"
> entity-group-reader="main" entity-eca-reader="main"
> entity-eca-enabled="false" distributed-cache-clear-enabled="false">
>         <group-map group-name="org.apache.ofbiz"
> datasource-name="localpostgres"/>
>         <group-map group-name="org.apache.ofbiz.olap"
> datasource-name="localpostolap"/>
>         <group-map group-name="org.apache.ofbiz.tenant"
> datasource-name="localposttenant"/>
>     </delegator>
>
>     <!-- be sure that your default delegator (or the one you use) uses the
> same datasource for test. You must run "gradlew loadDefault" before running
> "gradlew testIntegration" -->
>     <delegator name="test" entity-model-reader="main"
> entity-group-reader="main" entity-eca-reader="main">
>         <group-map group-name="org.apache.ofbiz"
> datasource-name="localpostgres"/>
>         <group-map group-name="org.apache.ofbiz.olap"
> datasource-name="localpostolap"/>
>         <group-map group-name="org.apache.ofbiz.tenant"
> datasource-name="localposttenant"/>
>     </delegator>
> ========================================================
>
>
> what is next?
>
>
>
>
> regds
> rajesh kr mallah.
Reply | Threaded
Open this post in threaded view
|

Re: multi tenant setup help

Rajesh Mallah
Hi Taher ,

README.md helped .. Shall update when  i am done completely.

thanks.
regds
mallah.

On Sun, Mar 11, 2018 at 12:54 AM, Taher Alkhateeb <
[hidden email]> wrote:

> Hello Rajesh,
>
> Did you try the README.md? It should be pretty comprehensive. Also,
> try to understand the overall design. Ignore for a second the syntax
> and think of the design of multi tenancy. You have the following
> databases:
>
> 1- The OFBiz standard single tenant instance (ofbiz)
> 2- A master database for all tenants (ofbizTenant)
> 3- A database per tenant.
>
> When you call the command createTenant, you essentially load that
> tenant's information into the tenants master database AND you also
> create a new database specific to that tenant.
>
> The main differentiation between the tenants is the delegator name.
> The default database has the delegator "delegator". Every tenant has a
> database with a delegator called "delegator#TenantIdHere"
>
> So, when loading specific data like seed, for a specific tenant, then
> you need to pass both the readers AND the correct delegator.
>
> I hope this helps and that I understood and answered your question
> appropriately.
>
> On Sat, Mar 10, 2018 at 9:29 PM, Rajesh Mallah <[hidden email]>
> wrote:
> > Hi ,
> >
> > I am trying to setup/configure ofbiz with multi tenant feature
> > i am following the doc
> >
> > https://cwiki.apache.org/confluence/display/OFBIZ/Multitenancy+support
> >
> > there are 2 gradle tasks related to tenants
> >
> > createTenant - Create a new tenant in your environment
> > loadTenant - Load data using tenantId
> >
> > however they are not referenced in that doc . More over the
> > docs refer to ant and the commands eg:
> >
> >
> > java -Xmx512m -XX:MaxPermSize=128m -jar ./build/libs/ofbiz.jar -install
> > -readers=seed,seed-initial,ext -delegator=default
> > does not really work.
> >
> >
> > could someone please point to some references that would help.
> >
> > particularly i have done till below
> >
> >
> >    - OFBIZ-HOME/framework/entity/data/<yourTenantConfig>.xml
> >    - OFBIZ-HOME/framework/entity/config/entityengine.xml
> >    - OFBIZ-HOME/framework/entity/ofbiz-component.xml
> >
> > and i ran
> >  ./gradlew "ofbiz --load-data readers=seed,seed-initial,ext "
> >
> > in ofbiz-component i have :
> >
> >     <entity-resource type="data"  reader-name="ext" loader="main"
> > location="data/TenantDemoData.xml"/>
> >
> > TenantDemoData.xml
> > =================
> >
> > <?xml version="1.0" encoding="UTF-8" ?>
> > <entity-engine-xml>
> > <Tenant tenantId="TENANT-A" tenantName="Tenant A"/>
> > <TenantDataSource tenantId="TENANT-A" entityGroupName="org.apache.ofbiz"
> > jdbcUri="jdbc:postgresql://postgresql/tenant_a_db"
> > jdbcUsername="ofbiz_cust_a" jdbcPassword="xxxxxxxxxxxx"/>
> > <TenantDataSource tenantId="TENANT-A"
> > entityGroupName="org.apache.ofbiz.olap"
> > jdbcUri="jdbc:postgresql://postgresql/tenant_a_db"
> > jdbcUsername="ofbiz_cust_a" jdbcPassword="xxxxxxxxxxxx"/>
> > </entity-engine-xml>
> >
> > ===========================
> >
> > entityengine.xml
> > =============================
> >
> >   <delegator name="default" entity-model-reader="main"
> > entity-group-reader="main" entity-eca-reader="main"
> > distributed-cache-clear-enabled="false">
> >         <group-map group-name="org.apache.ofbiz"
> > datasource-name="localpostgres"/>
> >         <group-map group-name="org.apache.ofbiz.olap"
> > datasource-name="localpostolap"/>
> >         <group-map group-name="org.apache.ofbiz.tenant"
> > datasource-name="localposttenant"/>
> >     </delegator>
> >     <delegator name="default-no-eca" entity-model-reader="main"
> > entity-group-reader="main" entity-eca-reader="main"
> > entity-eca-enabled="false" distributed-cache-clear-enabled="false">
> >         <group-map group-name="org.apache.ofbiz"
> > datasource-name="localpostgres"/>
> >         <group-map group-name="org.apache.ofbiz.olap"
> > datasource-name="localpostolap"/>
> >         <group-map group-name="org.apache.ofbiz.tenant"
> > datasource-name="localposttenant"/>
> >     </delegator>
> >
> >     <!-- be sure that your default delegator (or the one you use) uses
> the
> > same datasource for test. You must run "gradlew loadDefault" before
> running
> > "gradlew testIntegration" -->
> >     <delegator name="test" entity-model-reader="main"
> > entity-group-reader="main" entity-eca-reader="main">
> >         <group-map group-name="org.apache.ofbiz"
> > datasource-name="localpostgres"/>
> >         <group-map group-name="org.apache.ofbiz.olap"
> > datasource-name="localpostolap"/>
> >         <group-map group-name="org.apache.ofbiz.tenant"
> > datasource-name="localposttenant"/>
> >     </delegator>
> > ========================================================
> >
> >
> > what is next?
> >
> >
> >
> >
> > regds
> > rajesh kr mallah.
>
Reply | Threaded
Open this post in threaded view
|

Re: multi tenant setup help

Rajesh Mallah
Hello Everyone/Taher ,

i have been able to setup multi-tenant using various sources of
information.

Thanks for the tips/help.

regds
mallah.
Reply | Threaded
Open this post in threaded view
|

Re: multi tenant setup help

Rajesh Mallah
Hello Everyone/ Taher  ,

I have put together a detailed instruction steps for newbies here:

https://medium.com/@mallah.rajesh/single-and-multi-tenant-setup-of-ofbiz-erp-on-ubuntu-linux-an-walkthrough-for-newbies-d61d3552ad62

regds
mallah.


On Sun, Mar 11, 2018 at 3:29 PM, Rajesh Mallah <[hidden email]>
wrote:

> Hello Everyone/Taher ,
>
> i have been able to setup multi-tenant using various sources of
> information.
>
> Thanks for the tips/help.
>
> regds
> mallah.
>
Reply | Threaded
Open this post in threaded view
|

Re: multi tenant setup help

Michael Brohl-3
Hi Rajesh,

great work, thank you!

I'd like to encourage you to contribute this to the official OFBiz wiki
so that users can find and benefit from it.

If you like to do more work on the documentation, I'd also like to
invite you to join the OFBiz documentation team, see [1].

Thanks and regards,

Michael

[1]
https://cwiki.apache.org/confluence/display/OFBIZ/OFBiz+Documentation+Team


Am 11.03.18 um 21:51 schrieb Rajesh Mallah:

> Hello Everyone/ Taher  ,
>
> I have put together a detailed instruction steps for newbies here:
>
> https://medium.com/@mallah.rajesh/single-and-multi-tenant-setup-of-ofbiz-erp-on-ubuntu-linux-an-walkthrough-for-newbies-d61d3552ad62
>
> regds
> mallah.
>
>
> On Sun, Mar 11, 2018 at 3:29 PM, Rajesh Mallah <[hidden email]>
> wrote:
>
>> Hello Everyone/Taher ,
>>
>> i have been able to setup multi-tenant using various sources of
>> information.
>>
>> Thanks for the tips/help.
>>
>> regds
>> mallah.
>>


smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: multi tenant setup help

taher
I join Michael in thanking you rajesh, and highly recommend joining the
documentation team. You have a natural talent for this sort of work

On Mar 12, 2018 12:01 AM, "Michael Brohl" <[hidden email]> wrote:

Hi Rajesh,

great work, thank you!

I'd like to encourage you to contribute this to the official OFBiz wiki so
that users can find and benefit from it.

If you like to do more work on the documentation, I'd also like to invite
you to join the OFBiz documentation team, see [1].

Thanks and regards,

Michael

[1] https://cwiki.apache.org/confluence/display/OFBIZ/OFBiz+Docu
mentation+Team


Am 11.03.18 um 21:51 schrieb Rajesh Mallah:

Hello Everyone/ Taher  ,

>
> I have put together a detailed instruction steps for newbies here:
>
> https://medium.com/@mallah.rajesh/single-and-multi-tenant-se
> tup-of-ofbiz-erp-on-ubuntu-linux-an-walkthrough-for-newbies-d61d3552ad62
>
> regds
> mallah.
>
>
> On Sun, Mar 11, 2018 at 3:29 PM, Rajesh Mallah <[hidden email]>
> wrote:
>
> Hello Everyone/Taher ,
>>
>> i have been able to setup multi-tenant using various sources of
>> information.
>>
>> Thanks for the tips/help.
>>
>> regds
>> mallah.
>>
>>
Reply | Threaded
Open this post in threaded view
|

Re: multi tenant setup help

Rajesh Mallah
In reply to this post by Michael Brohl-3
Hi Michael / Taher ,

Thanks for the kind words. This writeup/article is in the public domain ,so
its
already contributed.

I will go through the cited reference and see to what extent i can involve.
contributing consistently itself is a very serious work and OFBiz has a
great
depth to which the documentation effort has to wade through.
I feel Short and focused writeups like these are relatively easy to
produce
than organizing the huge trove of documentation that already exists. Seeing
the recent activities and focus i feel OFBiz will sooner have a good set
of documentation.  I wish i could contribute more consistently but my
current
occupation leaves me with very little luxury time to do things which i
would
love to do  :-)

I guess , its more or less the same with most of the volunteers!.

regds
mallah.

On Mon, Mar 12, 2018 at 2:30 AM, Michael Brohl <[hidden email]>
wrote:

> Hi Rajesh,
>
> great work, thank you!
>
> I'd like to encourage you to contribute this to the official OFBiz wiki so
> that users can find and benefit from it.
>
> If you like to do more work on the documentation, I'd also like to invite
> you to join the OFBiz documentation team, see [1].
>
> Thanks and regards,
>
> Michael
>
> [1] https://cwiki.apache.org/confluence/display/OFBIZ/OFBiz+
> Documentation+Team
>
>
> Am 11.03.18 um 21:51 schrieb Rajesh Mallah:
>
> Hello Everyone/ Taher  ,
>>
>> I have put together a detailed instruction steps for newbies here:
>>
>> https://medium.com/@mallah.rajesh/single-and-multi-tenant-
>> setup-of-ofbiz-erp-on-ubuntu-linux-an-walkthrough-for-
>> newbies-d61d3552ad62
>>
>> regds
>> mallah.
>>
>>
>> On Sun, Mar 11, 2018 at 3:29 PM, Rajesh Mallah <[hidden email]>
>> wrote:
>>
>> Hello Everyone/Taher ,
>>>
>>> i have been able to setup multi-tenant using various sources of
>>> information.
>>>
>>> Thanks for the tips/help.
>>>
>>> regds
>>> mallah.
>>>
>>>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: multi tenant setup help

Sharan Foga
In reply to this post by Rajesh Mallah
Thanks Rajesh

This is a great article and excellent resource. We definitely need to include this in our documentation effort. :-)

Thanks
Sharan  

On 2018/03/11 20:51:11, Rajesh Mallah <[hidden email]> wrote:

> Hello Everyone/ Taher  ,
>
> I have put together a detailed instruction steps for newbies here:
>
> https://medium.com/@mallah.rajesh/single-and-multi-tenant-setup-of-ofbiz-erp-on-ubuntu-linux-an-walkthrough-for-newbies-d61d3552ad62
>
> regds
> mallah.
>
>
> On Sun, Mar 11, 2018 at 3:29 PM, Rajesh Mallah <[hidden email]>
> wrote:
>
> > Hello Everyone/Taher ,
> >
> > i have been able to setup multi-tenant using various sources of
> > information.
> >
> > Thanks for the tips/help.
> >
> > regds
> > mallah.
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: multi tenant setup help

innate Genius
Excellent Work Rajesh.

Regards,

Pratiek.

> On 12-Mar-2018, at 1:52 PM, Sharan Foga <[hidden email]> wrote:
>
> Thanks Rajesh
>
> This is a great article and excellent resource. We definitely need to include this in our documentation effort. :-)
>
> Thanks
> Sharan  
>
> On 2018/03/11 20:51:11, Rajesh Mallah <[hidden email]> wrote:
>> Hello Everyone/ Taher  ,
>>
>> I have put together a detailed instruction steps for newbies here:
>>
>> https://medium.com/@mallah.rajesh/single-and-multi-tenant-setup-of-ofbiz-erp-on-ubuntu-linux-an-walkthrough-for-newbies-d61d3552ad62
>>
>> regds
>> mallah.
>>
>>
>> On Sun, Mar 11, 2018 at 3:29 PM, Rajesh Mallah <[hidden email]>
>> wrote:
>>
>>> Hello Everyone/Taher ,
>>>
>>> i have been able to setup multi-tenant using various sources of
>>> information.
>>>
>>> Thanks for the tips/help.
>>>
>>> regds
>>> mallah.
>>>
>>