Apache - Tomcat Embebido 7 - Cluster

   
Vista:

Tomcat Embebido 7 - Cluster

Publicado por Pedro Alvarez (1 intervención) el 21/06/2012 02:20:18
Hola estoy implementando un cluster con apache tomcat 7.0.27, el tema es que seguí el howto de apache he implemente FarmWarDeployer, una vez codificado el server.xml lo ejecuto y obtengo los siguientes mensajes:

Jun 20, 2012 9:03:44 PM org.apache.catalina.startup.ContextConfig getDefaultWebXmlFragment
INFO: No global web.xml found
Jun 20, 2012 9:03:46 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jun 20, 2012 9:04:06 PM org.apache.catalina.ha.deploy.FarmWarDeployer fileModified
INFO: Installing webapp [/sample] from [/home/almir/Desktop/TomcatEmbedded/tomcat.8080/war-deploy/sample.war]
Jun 20, 2012 9:04:06 PM org.apache.catalina.ha.deploy.FarmWarDeployer remove
INFO: Cluster wide remove of web app [/sample]

Ademas al ejecutar el codigo solo consigo que se copie el war que tengo en la carpeta watchdir a la carpeta deploydir, pero no hace el deploy.

Si alguien me puede colaborar en que me estoy equivocando o que es lo que me falta se lo agradeceria

El código de mi aplicación es el siguiente:

String relativePath = new File("").getAbsolutePath() + File.separatorChar;

Tomcat tomcat = new Tomcat();
SimpleTcpCluster simpleTcpCluster = new SimpleTcpCluster();
DeltaManager deltaManager = new DeltaManager();
GroupChannel groupChannel = new GroupChannel();
McastService mcastService = new McastService();
NioReceiver nioReceiver = new NioReceiver();
ReplicationTransmitter replicationTransmitter = new ReplicationTransmitter();
PooledParallelSender pooledParallelSender = new PooledParallelSender();
TcpFailureDetector tcpFailureDetector = new TcpFailureDetector();
MessageDispatch15Interceptor messageDispatch15Interceptor = new MessageDispatch15Interceptor();
ThroughputInterceptor throughputInterceptor = new ThroughputInterceptor();
ReplicationValve replicationValve = new ReplicationValve();
FarmWarDeployer farmWarDeployer = new FarmWarDeployer();
JvmRouteSessionIDBinderListener jvmRouteSessionIDBinderListener = new JvmRouteSessionIDBinderListener();
ClusterSessionListener clusterSessionListener = new ClusterSessionListener();

deltaManager.setName("deltaManager");
deltaManager.setExpireSessionsOnShutdown(false);
deltaManager.setNotifyListenersOnReplication(true);

mcastService.setAddress("228.0.0.4");
mcastService.setPort(45564);
mcastService.setFrequency(500);
mcastService.setDropTime(3000);

nioReceiver.setAddress("auto");
nioReceiver.setPort(4000);
nioReceiver.setSelectorTimeout(100);
nioReceiver.setMaxThreads(6);

replicationValve.setFilter(".*/.gif|.*/.js|.*/.jpeg|.*/.jpg|.*/.png|.*/.htm|.*/.html|.*/.css|.*/.txt");
replicationValve.setStatistics(true);


farmWarDeployer.setTempDir(relativePath + "tomcat.8080/war-temp/");
farmWarDeployer.setDeployDir(relativePath + "tomcat.8080/war-deploy/");
farmWarDeployer.setWatchDir(relativePath + "tomcat.8080/war-listen/");
System.out.println("relativepath: " + relativePath);
farmWarDeployer.setWatchEnabled(true);

groupChannel.setMembershipService(mcastService);
groupChannel.setChannelReceiver(nioReceiver);
replicationTransmitter.setTransport(pooledParallelSender);
groupChannel.setChannelSender(replicationTransmitter);
groupChannel.addInterceptor(throughputInterceptor);
groupChannel.addInterceptor(tcpFailureDetector);
groupChannel.addInterceptor(messageDispatch15Interceptor);
groupChannel.setOptionCheck(true);

simpleTcpCluster.registerManager(deltaManager);
simpleTcpCluster.setChannel(groupChannel);
simpleTcpCluster.addValve(replicationValve);
simpleTcpCluster.setClusterDeployer(farmWarDeployer);
simpleTcpCluster.addClusterListener(jvmRouteSessionIDBinderListener);
simpleTcpCluster.addClusterListener(clusterSessionListener);

String contextPath = "/myapp";
String appBase = relativePath + "tomcat.8080/war-deploy/";

StandardServer server = (StandardServer) tomcat.getServer();
AprLifecycleListener listener = new AprLifecycleListener();
server.addLifecycleListener(listener);

tomcat.setBaseDir(".");
tomcat.addWebapp(contextPath, appBase);
tomcat.getHost().setCluster(simpleTcpCluster);

tomcat.getHost().setAutoDeploy(true);
tomcat.getHost().setDeployOnStartup(true);
tomcat.getEngine().setName("Catalina");
tomcat.getEngine().setDefaultHost("localhost");
tomcat.getEngine().setJvmRoute("node01");
tomcat.enableNaming();
tomcat.start();
tomcat.getServer().await();

Saludos.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder