Fórum

Problemas cluster tras actualización a GA6

Alberto de Francisco Martín, modificado 7 Anos atrás.

Problemas cluster tras actualización a GA6

New Member Postagens: 17 Data de Entrada: 01/02/10 Postagens Recentes
Muy buenas a todos.

Os comento mi caso a ver si podeis arrojarme algo de luz.

Disponía de un cluster configurado y funcionando correctamente bajo la GA4.
Actualmente me encuentro migrando de GA4 a GA6, actualización realizada mediante el proceso llamado "de bundle"; ya sabeis, bajando bundle, configurando y apuntando a BBDD; etc.
El proceso de actualización no me funcionaba con la configuración de cluster, por lo que decidí comentar ésta, actualizar y reconfigurar cluster.
Ya realicé el proceso de actualización pero el cluster sigue sin ser funcional.

Me arroja el siguiente error:

04:01:58,998 INFO  [localhost-startStop-1][LiferayCacheManagerPeerProviderFactory:72] portalPropertyKey ehcache.multi.vm.config.location.peerProviderProperties has value [file=/custom_jgroups/tcp_new.xml]
04:01:59,014 ERROR [localhost-startStop-1][ContextLoader:206] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.liferay.portal.kernel.cache.MultiVMPool' defined in class path resource [META-INF/util-spring.xml]: Cannot resolve reference to bean 'com.liferay.portal.kernel.cache.MultiVMPortalCacheManager' while setting bean property 'portalCacheManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.liferay.portal.kernel.cache.MultiVMPortalCacheManager' defined in class path resource [META-INF/util-spring.xml]: Cannot create inner bean 'com.liferay.portal.cache.ehcache.EhcachePortalCacheManager#7c909f39' of type [com.liferay.portal.cache.ehcache.EhcachePortalCacheManager] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.liferay.portal.cache.ehcache.EhcachePortalCacheManager#7c909f39' defined in class path resource [META-INF/util-spring.xml]: Invocation of init method failed; nested exception is net.sf.ehcache.CacheException: java.lang.NoSuchMethodError: net.sf.ehcache.util.ClassLoaderUtil.getStandardClassLoader()Ljava/lang/ClassLoader;
	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1327)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1085)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:516)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
	at com.liferay.portal.spring.context.PortalContextLoaderListener.contextInitialized(PortalContextLoaderListener.java:246)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5016)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5528)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:677)
	at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1912)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.liferay.portal.kernel.cache.MultiVMPortalCacheManager' defined in class path resource [META-INF/util-spring.xml]: Cannot create inner bean 'com.liferay.portal.cache.ehcache.EhcachePortalCacheManager#7c909f39' of type [com.liferay.portal.cache.ehcache.EhcachePortalCacheManager] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.liferay.portal.cache.ehcache.EhcachePortalCacheManager#7c909f39' defined in class path resource [META-INF/util-spring.xml]: Invocation of init method failed; nested exception is net.sf.ehcache.CacheException: java.lang.NoSuchMethodError: net.sf.ehcache.util.ClassLoaderUtil.getStandardClassLoader()Ljava/lang/ClassLoader;
	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:281)
	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:120)
	at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:630)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:441)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:982)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:878)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:484)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
	... 29 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.liferay.portal.cache.ehcache.EhcachePortalCacheManager#7c909f39' defined in class path resource [META-INF/util-spring.xml]: Invocation of init method failed; nested exception is net.sf.ehcache.CacheException: java.lang.NoSuchMethodError: net.sf.ehcache.util.ClassLoaderUtil.getStandardClassLoader()Ljava/lang/ClassLoader;
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1422)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:518)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:270)
	... 41 more
Caused by: net.sf.ehcache.CacheException: java.lang.NoSuchMethodError: net.sf.ehcache.util.ClassLoaderUtil.getStandardClassLoader()Ljava/lang/ClassLoader;
	at net.sf.ehcache.CacheManager.init(CacheManager.java:419)
	at net.sf.ehcache.CacheManager.<init>(CacheManager.java:264)
	at com.liferay.portal.cache.ehcache.CacheManagerUtil.createCacheManager(CacheManagerUtil.java:38)
	at com.liferay.portal.cache.ehcache.EhcachePortalCacheManager.afterPropertiesSet(EhcachePortalCacheManager.java:77)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1546)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1487)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1419)
	... 44 more
Caused by: java.lang.NoSuchMethodError: net.sf.ehcache.util.ClassLoaderUtil.getStandardClassLoader()Ljava/lang/ClassLoader;
	at net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory.createCachePeerProvider(JGroupsCacheManagerPeerProviderFactory.java:61)
	at com.liferay.portal.cache.ehcache.LiferayCacheManagerPeerProviderFactory.createCachePeerProvider(LiferayCacheManagerPeerProviderFactory.java:96)
	at net.sf.ehcache.config.ConfigurationHelper.createCachePeerProviders(ConfigurationHelper.java:136)
	at net.sf.ehcache.CacheManager.configure(CacheManager.java:758)
	at net.sf.ehcache.CacheManager.doInit(CacheManager.java:464)
	at net.sf.ehcache.CacheManager.init(CacheManager.java:388)
	... 54 more</init>


Mi configuración, antes funcional, era la siguiente:

Configuro mediante archivo de configuración de jgroups (tcp.xml):

<config xmlns="urn:org:jgroups" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation="urn:org:jgroups http://www.jgroups.org/schema/JGroups-3.1.xsd">
    <tcp singleton_name="liferay" bind_port="7800" loopback="false" recv_buf_size="${tcp.recv_buf_size:5M}" send_buf_size="${tcp.send_buf_size:640K}" max_bundle_size="64K" max_bundle_timeout="30" enable_bundling="true" use_send_queues="true" sock_conn_timeout="300" timer_type="old" timer.min_threads="4" timer.max_threads="10" timer.keep_alive_time="3000" timer.queue_max_size="500" thread_pool.enabled="true" thread_pool.min_threads="1" thread_pool.max_threads="10" thread_pool.keep_alive_time="5000" thread_pool.queue_enabled="false" thread_pool.queue_max_size="100" thread_pool.rejection_policy="discard" oob_thread_pool.enabled="true" oob_thread_pool.min_threads="1" oob_thread_pool.max_threads="8" oob_thread_pool.keep_alive_time="5000" oob_thread_pool.queue_enabled="false" oob_thread_pool.queue_max_size="100" oob_thread_pool.rejection_policy="discard" />
                         
    <tcpping timeout="5000" initial_hosts="${jgroups.tcpping.initial_hosts:localhost[7800],localhost[7801]}" port_range="1" num_initial_members="10" />
    <merge2 min_interval="10000" max_interval="30000" />
    <fd_sock />
    <fd timeout="3000" max_tries="3" />
    <verify_suspect timeout="1500" />
    <barrier />
    <pbcast.nakack2 use_mcast_xmit="false" discard_delivered_msgs="true" />
    <unicast />
    <pbcast.stable stability_delay="1000" desired_avg_gossip="50000" max_bytes="4M" />
    <pbcast.gms print_local_addr="true" join_timeout="3000" view_bundling="true" />
    <ufc max_credits="2M" min_threshold="0.4" />
    <mfc max_credits="2M" min_threshold="0.4" />
    <frag2 frag_size="60K" />
    <!--RSVP resend_interval="2000" timeout="10000"/-->
    <pbcast.state_transfer />
</config>


Y mi configuración en relación a cluster en el portal-ext-properties es la siguiente:

cluster.link.channel.properties.control=/custom_jgroups/tcp_new.xml
cluster.link.channel.properties.transport.0=/custom_jgroups/tcp_new.xml
cluster.link.enabled=true
cluster.link.autodetect.address=MAQAPP40:3306

ehcache.bootstrap.cache.loader.factory=com.liferay.portal.cache.ehcache.JGroupsBootstrapCacheLoaderFactory
ehcache.cache.event.listener.factory=net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory
ehcache.cache.manager.peer.provider.factory=net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory
ehcache.multi.vm.config.location.peerProviderProperties=file=/custom_jgroups/tcp_new.xml

lucene.replicate.write=true
lucene.dir=D:/liferay-portal-6.2-ce-ga6/lucene/

net.sf.ehcache.configurationResourceName.peerProviderProperties=file=/custom_jgroups/tcp_new.xml
cluster.executor.debug.enabled=true


Además, le doy valor a las variables de jgroups mediante, bien el fichero setenv o en las propiedades de servicio si lo levanto como tal:
set "CATALINA_OPTS=%CATALINA_OPTS% -Dfile.encoding=UTF8 -Djava.net.preferIPv4Stack=true  -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false -Duser.timezone=GMT -Xmx8096m -XX:MaxPermSize=512m"

set "CATALINA_OPTS=%CATALINA_OPTS% -Djgroups.bind_addr=MAQAPP08 -Djgroups.bind_port=7800"
set "CATALINA_OPTS=%CATALINA_OPTS% -Djgroups.tcpping.initial_hosts=172.15.32.64[7800],172.15.32.65[7800]"


Como es decía, ésta configuración hasta el momento de la actualización era totalmente válida.
¿Qué creeis que puede estar pasando?
¿Me arrojais algo de luz?
thumbnail
Miguel Ángel Júlvez, modificado 7 Anos atrás.

RE: Problemas cluster tras actualización a GA6

Junior Member Postagens: 63 Data de Entrada: 29/03/11 Postagens Recentes
Hola Alberto!

igual este ticket tiene relación https://issues.liferay.com/browse/LPS-61289

Saludos
thumbnail
Juan Gonzalez, modificado 7 Anos atrás.

RE: Problemas cluster tras actualización a GA6

Liferay Legend Postagens: 3089 Data de Entrada: 28/10/08 Postagens Recentes
Hola Alberto.

Como ha dicho Miguel Júlvez, en ese LPS tienes la solución. Adjunté un ehcache-jgroupsreplication.jar para que lo reemplaces y ya debería funcionar.
Alberto de Francisco Martín, modificado 7 Anos atrás.

RE: Problemas cluster tras actualización a GA6

New Member Postagens: 17 Data de Entrada: 01/02/10 Postagens Recentes
Sois grandes !
Me dió la pista @Miguel Angel y, a falta de realizar pruebas exhaustivas, el proceso ya arranca y traslada bien las propiedades de jGroups; lo cual es un paso teniendo en cuenta que me estaba volviendo ya un poco loco. emoticon

En cuanto realice pruebas os doy el ok 100%; pero tiene muy buena pinta.

Gracias por el fix @Juan. Por otra parte, Miguel Angel tambien me ha advertido que la librería adjuntada fue compilada con JDK8, tal y como indicas en la issue. ¿Crees que es necesario que la compile para JDK7 en mi caso?

Un saludo y gracias a ambos.
thumbnail
Juan Gonzalez, modificado 7 Anos atrás.

RE: Problemas cluster tras actualización a GA6

Liferay Legend Postagens: 3089 Data de Entrada: 28/10/08 Postagens Recentes
Alberto de Francisco Martín:
Sois grandes !
Me dió la pista @Miguel Angel y, a falta de realizar pruebas exhaustivas, el proceso ya arranca y traslada bien las propiedades de jGroups; lo cual es un paso teniendo en cuenta que me estaba volviendo ya un poco loco. emoticon

En cuanto realice pruebas os doy el ok 100%; pero tiene muy buena pinta.

Gracias por el fix @Juan. Por otra parte, Miguel Angel tambien me ha advertido que la librería adjuntada fue compilada con JDK8, tal y como indicas en la issue. ¿Crees que es necesario que la compile para JDK7 en mi caso?

Un saludo y gracias a ambos.


Me temo que si usas JDK 7 tendrás que compilarlo en esa versión. Simplemente bájate el código de este repositorio Subversion: http://svn.terracotta.org/svn/ehcache/trunk/jgroupsreplication/ y ejecuta mvn install.

Un saludo.