« 返回到 Database...

Database Sharding

Introduction #

Database sharding is a way of scaling your database horizontally. For a given table or set of tables, you split up the data that is stored and fetched based on a given hash or something like that. Google, Facebook, and Wikipedia all use database sharding.

Benefits #

  • One database does not get overloaded
  • Smaller queries (since each table has less data now)
  • Better overall throughput under load because all your IO is not going through one database server.

Sharded Portal Instances #

At present, sharding exists in Liferay from version 5.2.3+ for handling data across multiple portal instances. Here's what you do to get it up.

  1. After you have a normally working development environment, make sure your hosts file is setup to allow virtual hosting (for our convenience, I will call the hosts abc1.com, abc2.com, abc3.com, etc.).
  2. Use the create-minimal SQL script (from our Downloads section) to create and populate three database schemas: lportal, lportal1, and lportal2. Be careful and use the scripts for your liferay portal version, otherwise, it won't work. In 6.0, if you simply create several empty database schemas manually, when Liferay starts up with sharding enabled, it will automatically populate the schemas.
    1. Note: By default, the configuration files are setup for three schemas called default, one and two, but you can configure it for more. All this configuration is set up in the file portal-impl/src/META-INF/shard-data-source-spring.xml . As you will see, we will include this file in the property spring.configs in the next step. In case we want to modify it we just should write our own file in the Extension Environment and include it in this property instead of the default one.
  3. In your portal-ext.properties, you will need to set the following:
    1. Enable
      META-INF/shard-data-source-spring.xml and bunch of other spring configs (refer to "Additional Settings" section below)
       under
      spring.configs
      .
    2. Configure the jdbc schema settings for
      jdbc.default.*
      ,
      jdbc.one.*
      , and
      jdbc.two.*
      .
    3. Enable the shard names:
      shard.available.names=default,one,two
  4. Don't forget to set the appropriate username and password for each schema.
  5. Startup the server and create several (2-3) portal instances (e.g., abc1.com, abc2.com, abc3.com).
  6. Using your favorite database browser, do a query on each of your schemas for the User_ table, and you will notice that the data is now distributed across different schemas. That's it!

Additional Settings #

Remember that default, one, and two are default values defined in portal-impl/src/META-INF/shard-data-source-spring.xml and portal-ext.properties. If you want to change it, make sure to propagate the changes to the spring XML file as well as portal-ext.properties.

  • If you want to manually select the shard (via the GUI when creating portal instances), you need to enable in your portal-ext.properties file:
    shard.selector=com.liferay.portal.dao.shard.ManualShardSelector
    . Otherwise, the shard for the data will be chosen using a round robin technique.
  • Due to the nature of sharding across multiple data sources, it does not support transaction management by itself. In order to enable proper transaction management, you will need to configure JTA/XA. For example, see JTA-XA on Tomcat.
  • Following spring configs also need to be added to portal-ext.properties in 6.1 version ..
    spring.configs= \META-INF/base-spring.xml,   \META-INF/hibernate-spring.xml,  \META-INFinfrastructure-spring.xml,  \META-INF/management-spring.xml,  \META-INF/util-spring.xml,  \META-INF/jpa-spring.xml,  \META-INF/executor-spring.xml,  \META-INF/audit-spring.xml,  \META-INF/cluster-spring.xml,  \META-INF/editor-spring.xml,  \META-INF/executor-spring.xml,  \META-INF/jcr-spring.xml,  \META-INF/ldap-spring.xml,  \META-INF/messaging-core-spring.xml,  \META-INF/messaging-misc-spring.xml,  \META-INF/mobile-device-spring.xml,  \META-INF/notifications-spring.xml,  \META-INF/poller-spring.xml,  \META-INF/rules-spring.xml,  \META-INF/scheduler-spring.xml,  \META-INF/scripting-spring.xml,  \META-INF/search-spring.xml,  \META-INF/workflow-spring.xml,  \META-INF/counter-spring.xml,  \META-INF/document-library-spring.xml,  \META-INF/mail-spring.xml,  \META-INF/portal-spring.xml,  \META-INF/portlet-container-spring.xml,  \META-INF/shard-data-source-spring.xml,  \META-INF/ext-spring.xml

Please note that for 6.0 version of the Liferay portal the following spring configs should be added to portal-ext.properties instead of the above mentioned ones:

spring.configs=\META-INF/base-spring.xml,
META-INF/hibernate-spring.xml,\META-INF/infrastructure-spring.xml,\META-INF/management-spring.xml,
META-INF/util-spring.xml,
META-INF/editor-spring.xml,\META-INF/jcr-spring.xml,\META-INF/messaging-spring.xml,\META-INF/scheduler-spring.xml,\META-INF/search-spring.xml,
META-INF/counter-spring.xml,\META-INF/document-library-spring.xml,\META-INF/lock-spring.xml,\META-INF/mail-spring.xml,\META-INF/portal-spring.xml,\META-INF/portlet-container-spring.xml,\META-INF/wsrp-spring.xml,
META-INF/mirage-spring.xml,
\META-INF/shard-data-source-spring.xml
0 附件
78746 查看
平均 (6 票)
满分为 5,平均得分为 4.5。
评论
讨论主题回复 作者 日期
I´ll try it right now. Will comment soon Aritz Galdos 2009年7月20日 上午12:32
Great!! It simply works!! Aritz Galdos 2009年7月20日 上午1:22
Very good feature! Jonas Yuan 2009年7月25日 上午7:48
Dear Alex, It would be really nice if a new... Ahamed Hasan 2009年12月2日 上午9:53
Is Sharding works fine with 5.2.3 - it is... Faisal K 2010年2月19日 上午8:48
Its great.. definitely will try on 6.0.x ... Ravi Kumar Gupta 2010年11月17日 上午3:57
It works fine with Liferay 6.1 Kiran Kanaparthi 2012年1月17日 上午12:24
More neat details at ... Raja Nagendra Kumar 2012年6月15日 下午5:38
There is a reference to the Extension... Danny Stevens 2012年7月30日 下午5:10
Because users of sharding a probably always... Danny Stevens 2012年7月30日 下午5:17
Hi all any one had the same problem with... Suresh Nimmakayala 2013年8月4日 下午8:31
Added a section in "Additional Settings"... Abhay Chaware 2013年8月28日 下午11:40
I'm working with sharing on Liferay portal 6.2... Nelson Aguayo 2014年7月1日 下午1:16
*sharding Nelson Aguayo 2014年7月1日 下午1:41
*sharding Nelson Aguayo 2014年7月1日 下午1:41
Check folowing link for database sharding ... Mitul Khamar 2015年5月21日 上午6:03

I´ll try it right now. Will comment soon
在 09-7-20 上午12:32 发帖。
在 09-7-20 上午1:22 发帖。
在 09-7-25 上午7:48 发帖。
Dear Alex,

It would be really nice if a new database schema is created when the adminstrator creates an instance, so that we need not have to do all configuration in properties and xml files and re-start the server.
在 09-12-2 上午9:53 发帖。
Is Sharding works fine with 5.2.3 - it is mentioned 5.2.3+, I am getting Exception like this
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liferayTransactionManager' defined in class path resource [META-INF/hibernate-spring.xml]: Cannot resolve reference to bean 'liferayHibernateSessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liferayHibernateSessionFactory' defined in class path resource [META-INF/shard-data-source-spring.xml]: Cannot resolve reference to bean 'shardSessionFactoryTargetSource' while setting bean property 'targetSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shardSessionFactoryTargetSource' defined in class path resource [META-INF/shard-data-source-spring.xml]: Cannot create inner bean 'com.liferay.portal.spring.hibernate.PortalHibernateConfiguration#88d319' of type [com.liferay.portal.spring.hibernate.PortalHibernateConfiguration] while setting bean property 'sessionFactories' with key [TypedStringValue: value , target type ]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.liferay.portal.spring.hibernate.PortalHibernateConfiguration#88d319' defined in class path resource [META-INF/shard-data-source-spring.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveRef­erence(BeanDefinitionValueResolver.java:275)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveVal­ueIfNecessary(BeanDefinitionValueResolver.java:104)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.app­lyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.pop­ulateBean(AbstractAutowireCapableBeanFactory.java:1010)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doC­reateBean(AbstractAutowireCapableBeanFactory.java:472)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.r­un(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.cre­ateBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(Abstra­ctBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingle­ton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(Abstract­BeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBe­anFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBe­anFactory.java:164)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveRef­erence(BeanDefinitionValueResolver.java:269)
... 43 more
在 10-2-19 上午8:48 发帖。
Its great.. definitely will try on 6.0.x

Thanks for sharing.
在 10-11-17 上午3:57 发帖。
It works fine with Liferay 6.1
在 12-1-17 上午12:24 发帖。
More neat details at

http://www.liferay.com/documentation/liferay-portal/6.1/user-guide/-/ai/lifera­y-clusteri-2
在 12-6-15 下午5:38 发帖。
There is a reference to the Extension Environment in this article which is obsolete. I beleive it should now reference the Ext Plugin instead.
在 12-7-30 下午5:10 发帖以回复 Raja Nagendra Kumar
Because users of sharding a probably always going to want to change shard-data-source-spring.xml a detailed example of best practice for doing this would be very useful here.
在 12-7-30 下午5:17 发帖以回复 Danny Stevens
Hi all any one had the same problem with shrding, please help what i need to do

i got 6.0eesp2 lportal , database upgraded from prev version, i want to use Database Sharding.
followed steps

jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncodin­g=UTF-8&useFastDateParsing=false&zeroDateTimeBehavior=convertToNull
jdbc.default.username=xxx
jdbc.default.password=xxxxx

jdbc.one.driverClassName=com.mysql.jdbc.Driver
jdbc.one.url=jdbc:mysql://localhost/lportal1?useUnicode=true&characterEncoding=U­TF-8&useFastDateParsing=false&zeroDateTimeBehavior=convertToNull
jdbc.one.username=xxx
jdbc.one.password=xxxx

jdbc.two.driverClassName=com.mysql.jdbc.Driver
jdbc.two.url=jdbc:mysql://localhost/lportal2?useUnicode=true&characterEncoding=U­TF-8&useFastDateParsing=false&zeroDateTimeBehavior=convertToNull
jdbc.two.username=xxx
jdbc.two.password=xxxxx


shard.selector=com.liferay.portal.dao.shard.ManualShardSelector
shard.available.names=default,one,two
shard.default.name=default



##
## Spring
##

#
# Input a list of comma delimited Spring configurations. These will be
# loaded after the bean definitions specified in the contextConfigLocation
# parameter in web.xml.
#
# Note that there is a special case for hibernate-spring.xml and
# jpa-spring.xml. Even though both files are specified, only one will
# actually load at runtime based on the property "persistence.provider".
#
spring.configs=\
META-INF/base-spring.xml,\
\
META-INF/hibernate-spring.xml,\
META-INF/infrastructure-spring.xml,\
META-INF/management-spring.xml,\
\
META-INF/util-spring.xml,\
\
META-INF/jpa-spring.xml,\
\
META-INF/audit-spring.xml,\
META-INF/cluster-spring.xml,\
META-INF/editor-spring.xml,\
META-INF/executor-spring.xml,\
META-INF/jcr-spring.xml,\
META-INF/ldap-spring.xml,\
META-INF/messaging-core-spring.xml,\
META-INF/messaging-misc-spring.xml,\
META-INF/mobile-device-spring.xml,\
META-INF/notifications-spring.xml,\
META-INF/poller-spring.xml,\
META-INF/rules-spring.xml,\
META-INF/scheduler-spring.xml,\
META-INF/scripting-spring.xml,\
META-INF/search-spring.xml,\
META-INF/workflow-spring.xml,\
\
META-INF/counter-spring.xml,\
META-INF/mail-spring.xml,\
META-INF/portal-spring.xml,\
META-INF/portlet-container-spring.xml,\
META-INF/staging-spring.xml,\
META-INF/virtual-layouts-spring.xml,\
\
#META-INF/dynamic-data-source-spring.xml,\
META-INF/shard-data-source-spring.xml,\
#META-INF/memcached-spring.xml,\
#META-INF/monitoring-spring.xml,\
\
META-INF/ext-spring.xml


created lportal1 and lportal2 with create-minimal-mysql

i have a problem to make up and running
----------------
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.liferay.portlet.messageboards.service.MBThreadLocalService' defined in class path resource [META-INF/portal-spring.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.liferay.portlet.messageboards.service.MBThreadService' defined in class path resource [META-INF/portal-spring.xml]: Initialization of bean failed; nested exception is com.liferay.portal.kernel.bean.BeanLocatorException: BeanFactory could not find bean: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'com.liferay.documentlibrary.service.DLLocalService' is defined

and PortalBeanLocator failed with: BeanLocator has not been set
... 1024 more
Caused by: com.liferay.portal.kernel.bean.BeanLocatorException: BeanFactory could not find bean: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'com.liferay.documentlibrary.service.DLLocalService' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefi­nition(DefaultListableBeanFactory.java:527)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBean­Definition(AbstractBeanFactory.java:1083)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(Abstract­BeanFactory.java:274)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBe­anFactory.java:190)
at com.liferay.portal.spring.bean.BeanReferenceAnnotationBeanPostProcessor._autoInj­ect(BeanReferenceAnnotationBeanPostProcessor.java:135)
at com.liferay.portal.spring.bean.BeanReferenceAnnotationBeanPostProcessor._autoInj­ect(BeanReferenceAnnotationBeanPostProcessor.java:177)
at com.liferay.portal.spring.bean.BeanReferenceAnnotationBeanPostProcessor.postProc­essBeforeInitialization(BeanReferenceAnnotationBeanPostProcessor.java:75)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.app­lyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java­:394)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.ini­tializeBean(AbstractAutowireCapableBeanFactory.java:1413)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doC­reateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.cre­ateBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(Abstra­ctBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingle­ton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(Abstract­BeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBe­anFactory.java:190)
at com.liferay.portal.spring.bean.BeanReferenceAnnotationBeanPostProcessor._autoInj­ect(BeanReferenceAnnotationBeanPostProcessor.java:135)
at com.liferay.portal.spring.bean.BeanReferenceAnnotationBeanPostProcessor._autoInj­ect(BeanReferenceAnnotationBeanPostProcessor.java:177)
at com.liferay.portal.spring.bean.BeanReferenceAnnotationBeanPostProcessor.postProc­essBeforeInitialization(BeanReferenceAnnotationBeanPostProcessor.java:75)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.app­lyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java­:394)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.ini­tializeBean(AbstractAutowireCapableBeanFactory.java:1413)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doC­reateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.cre­ateBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(Abstra­ctBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingle­ton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(Abstract­BeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBe­anFactory.java:190)
and PortalBeanLocator failed with: BeanLocator has not been set
... 1024 more
Caused by: com.liferay.portal.kernel.bean.BeanLocatorException: BeanFactory could not find bean: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'com.liferay.documentlibrary.service.DLLocalService' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefi­nition(DefaultListableBeanFactory.java:527)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBean­Definition(AbstractBeanFactory.java:1083)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(Abstract­BeanFactory.java:274)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBe­anFactory.java:190)
at com.liferay.portal.spring.bean.BeanReferenceAnnotationBeanPostProcessor._autoInj­ect(BeanReferenceAnnotationBeanPostProcessor.java:135)
at com.liferay.portal.spring.bean.BeanReferenceAnnotationBeanPostProcessor._autoInj­ect(BeanReferenceAnnotationBeanPostProcessor.java:177)
at com.liferay.portal.spring.bean.BeanReferenceAnnotationBeanPostProcessor.postProc­essBeforeInitialization(BeanReferenceAnnotationBeanPostProcessor.java:75)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.app­lyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java­:394)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.ini­tializeBean(AbstractAutowireCapableBeanFactory.java:1413)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doC­reateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.cre­ateBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(Abstra­ctBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingle­ton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(Abstract­BeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBe­anFactory.java:190)
at com.liferay.portal.spring.bean.BeanReferenceAnnotationBeanPostProcessor._autoInj­ect(BeanReferenceAnnotationBeanPostProcessor.java:135)
at com.liferay.portal.spring.bean.BeanReferenceAnnotationBeanPostProcessor._autoInj­ect(BeanReferenceAnnotationBeanPostProcessor.java:177)
at com.liferay.portal.spring.bean.BeanReferenceAnnotationBeanPostProcessor.postProc­essBeforeInitialization(BeanReferenceAnnotationBeanPostProcessor.java:75)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.app­lyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java­:394)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.ini­tializeBean(AbstractAutowireCapableBeanFactory.java:1413)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doC­reateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.cre­ateBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(Abstra­ctBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingle­ton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(Abstract­BeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBe­anFactory.java:190)

and PortalBeanLocator failed with: BeanLocator has not been set
... 1024 more
Caused by: com.liferay.portal.kernel.bean.BeanLocatorException: BeanFactory could not find bean: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'com.liferay.documentlibrary.service.DLLocalService' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefi­nition(DefaultListableBeanFactory.java:527)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBean­Definition(AbstractBeanFactory.java:1083)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(Abstract­BeanFactory.java:274)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBe­anFactory.java:190)
at com.liferay.portal.spring.bean.BeanReferenceAnnotationBeanPostProcessor._autoInj­ect(BeanReferenceAnnotationBeanPostProcessor.java:135)
at com.liferay.portal.spring.bean.BeanReferenceAnnotationBeanPostProcessor._autoInj­ect(BeanReferenceAnnotationBeanPostProcessor.java:177)
at com.liferay.portal.spring.bean.BeanReferenceAnnotationBeanPostProcessor.postProc­essBeforeInitialization(BeanReferenceAnnotationBeanPostProcessor.java:75)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.app­lyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java­:394)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.ini­tializeBean(AbstractAutowireCapableBeanFactory.java:1413)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doC­reateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.cre­ateBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(Abstra­ctBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingle­ton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(Abstract­BeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBe­anFactory.java:190)
at com.liferay.portal.spring.bean.BeanReferenceAnnotationBeanPostProcessor._autoInj­ect(BeanReferenceAnnotationBeanPostProcessor.java:135)
at com.liferay.portal.spring.bean.BeanReferenceAnnotationBeanPostProcessor._autoInj­ect(BeanReferenceAnnotationBeanPostProcessor.java:177)
at com.liferay.portal.spring.bean.BeanReferenceAnnotationBeanPostProcessor.postProc­essBeforeInitialization(BeanReferenceAnnotationBeanPostProcessor.java:75)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.app­lyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java­:394)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.ini­tializeBean(AbstractAutowireCapableBeanFactory.java:1413)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doC­reateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.cre­ateBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(Abstra­ctBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingle­ton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(Abstract­BeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBe­anFactory.java:190)
在 13-8-4 下午8:31 发帖以回复 Danny Stevens
Added a section in "Additional Settings" listing bunch of spring configs that need to be added to portal-ext.properties for liferay-portal-6.1.1-ce-ga2.
在 13-8-28 下午11:40 发帖。
I'm working with sharing on Liferay portal 6.2 EE ga1, the best way is copy the spring section from portal.properties, then paste in portal-ext.properties and finally uncomment
#META-INF/shard-data-source-spring.xml

my comment is complementary to the section: Additional Settings
在 14-7-1 下午1:16 发帖。
在 14-7-1 下午1:41 发帖以回复 Nelson Aguayo
在 14-7-1 下午1:41 发帖以回复 Nelson Aguayo
Check folowing link for database sharding

http://mitulkhamar.blogspot.in/2015/05/database-sharding.html
在 15-5-21 上午6:03 发帖。