Orient db distributed database configuration - orientdb

I am unable to configure distributed databases using https://github.com/orientechnologies/orientdb/wiki/Tutorial%3A-setup-a-distributed-database
I am using orientdb community 1.7.5 edition.
The nodes aren't able to connect to each other. I am configuring it on same server and have followed each and every instruction given in above link.
Update:
there weren't any error earlier however got this error last time when I tried.
here aren't any errors earlier. but got below error last time when I tried...
00:55:15:315 INFO [152.144.227.223]:2434 [orientdb] [3.2.2] Accepting socket connection from /152.144.227.223:56818 [SocketAcceptor]
2014-07-23 00:55:15:321 INFO [152.144.227.223]:2434 [orientdb] [3.2.2] 2434 accepted socket connection from /152.144.227.223:56818 [TcpIpConnectionManager]
2014-07-23 00:55:16:321 WARN [152.144.227.223]:2434 [orientdb] [3.2.2] Invalid join request from: Address[152.144.227.223]:2435, reason:Incompatible joiners! -vs- tcp-ip [ClusterService]
2014-07-23 00:55:16:325 INFO [152.144.227.223]:2434 [orientdb] [3.2.2] Connection [Address[152.144.227.223]:2435] lost. Reason: Socket explicitly closed [TcpIpConnection]
also find below the hazlecase configuration.its same for both nodes. nodes are on same machine.
<network>
<port auto-increment="true">2434</port>
<join>
<multicast enabled="false">
<multicast-group>235.1.1.1</multicast-group>
<multicast-port>2434</multicast-port>
</multicast>
</join>
<tcp-ip enabled="true">
<member>152.144.227.223:2434</member>
<member>152.144.227.223:2435</member>
</tcp-ip>
</network>
tried by changing the port in hazlecast to 152.144.227.223:2424/2425 and got below warning when starting node1.
2014-07-23 01:14:27:157 INFO null [orientdb] [3.2.2] Picked Address[152.144.227.223]:2434, using socket ServerSocket[addr=/0:0:0:0:0:0:0:0,localport=2434], bind any local is true [DefaultAddressPicker]
2014-07-23 01:14:27:252 INFO [152.144.227.223]:2434 [orientdb] [3.2.2] Hazelcast Community Edition 3.2.2 (20140527) starting at Address[152.144.227.223]:2434 [system]
2014-07-23 01:14:27:254 INFO [152.144.227.223]:2434 [orientdb] [3.2.2] Copyright (C) 2008-2014 Hazelcast.com [system]
2014-07-23 01:14:27:258 INFO [152.144.227.223]:2434 [orientdb] [3.2.2] Address[152.144.227.223]:2434 is STARTING [LifecycleService]
2014-07-23 01:14:27:424 WARN [152.144.227.223]:2434 [orientdb] [3.2.2] No join method is enabled! Starting standalone. [Node]
2014-07-23 01:14:27:457 INFO [152.144.227.223]:2434 [orientdb] [3.2.2] Address[152.144.227.223]:2434 is STARTED [LifecycleService]
NEW ERROR
getting below error on both nodes
2014-08-08 16:27:37:309 INFO [192.168.159.134]:2434 [orientdb] [3.2.2] Hazelcast Community Edition 3.2.2 (20140527) starting at Address[192.168.159.134]:2434 [system]
2014-08-08 16:27:37:309 INFO [192.168.159.134]:2434 [orientdb] [3.2.2] Copyright (C) 2008-2014 Hazelcast.com [system]
2014-08-08 16:27:37:356 INFO [192.168.159.134]:2434 [orientdb] [3.2.2] Address[192.168.159.134]:2434 is STARTING [LifecycleService]
2014-08-08 16:27:38:494 WARN [192.168.159.134]:2434 [orientdb] [3.2.2] No join method is enabled! Starting standalone. [Node]
2014-08-08 16:27:38:869 INFO [192.168.159.134]:2434 [orientdb] [3.2.2] Address[192.168.159.134]:2434 is STARTED [LifecycleService]

To be able to form clusters you need to add tcp-ip tag inside the join tag of the hazelcast configuration. The error which you are facing because of No join method will be resolved. Your hazelcast configuration file should look like this:
<join>
<multicast enabled="false">
<multicast-group>235.1.1.1</multicast-group>
<multicast-port>2434</multicast-port>
</multicast>
<tcp-ip enabled="true">
<member>152.144.227.223:2434</member>
<member>152.144.227.223:2435</member>
</tcp-ip>
</join>

Related

OrientDB & .Net driver: Unable to read data from the transport connection

Getting error while reading network stream from a successful socket connection. PL see the debug log from orient DB:
2016-04-08 18:08:51:590 WARNI Not enough physical memory available for DISKCACHE: 1,977MB (heap=494MB). Set lower Maximum Heap (-Xmx setting on JVM) and restart OrientDB. Now
running with DISKCACHE=256MB [orientechnologies]
2016-04-08 18:08:51:606 INFO OrientDB config DISKCACHE=-566MB (heap=494MB os=1,977MB disk=16,656MB) [orientechnologies]
2016-04-08 18:08:51:809 INFO Loading configuration from: C:/inetpub/wwwroot/orientdb-2.1.5/config/orientdb-server-config.xml... [OServerConfigurationLoaderXml]
2016-04-08 18:08:52:292 INFO OrientDB Server v2.1.5 (build 2.1.x#r${buildNumber}; 2015-10-29 16:54:25+0000) is starting up... [OServer]
2016-04-08 18:08:52:370 INFO Databases directory: C:\inetpub\wwwroot\orientdb-2.1.5\databases [OServer]
2016-04-08 18:08:52:495 INFO Listening binary connections on 127.0.0.1:2424 (protocol v.32, socket=default) [OServerNetworkListener]
2016-04-08 18:08:52:511 INFO Listening http connections on 127.0.0.1:2480 (protocol v.10, socket=default) [OServerNetworkListener]
2016-04-08 18:08:52:573 INFO Installing dynamic plugin 'studio-2.1.zip'... [OServerPluginManager]
2016-04-08 18:08:52:838 INFO Installing GREMLIN language v.2.6.0 - graph.pool.max=50 [OGraphServerHandler]
2016-04-08 18:08:52:838 INFO [OVariableParser.resolveVariables] Error on resolving property: distributed [orientechnologies]
2016-04-08 18:08:52:854 INFO Installing Script interpreter. WARN: authenticated clients can execute any kind of code into the server by using the following allowed languages:
[sql] [OServerSideScriptInterpreter]
2016-04-08 18:08:52:854 INFO OrientDB Server v2.1.5 (build 2.1.x#r${buildNumber}; 2015-10-29 16:54:25+0000) is active. [OServer]
2016-04-08 18:08:57:986 INFO /127.0.0.1:49243 - Connected [OChannelBinaryServer]
2016-04-08 18:08:58:002 INFO /127.0.0.1:49243 - Writing short (2 bytes): 32 [OChannelBinaryServer]
2016-04-08 18:08:58:002 INFO /127.0.0.1:49243 - Flush [OChannelBinaryServer]
2016-04-08 18:08:58:002 INFO /127.0.0.1:49243 - Reading byte (1 byte)... [OChannelBinaryServer]
Using OrientDB .Net binary (C# driver) in Windows Vista. This was working fine until recently. Not sure what broke it...
Resetting TCP/IP using NetShell utility did not help.
Any help is highly appreciated.
The problem was with the AVG anti-virus program that is blocking the socket. Added an exception in the program for localhost to fix the problem.

What causes this OrientDB startup error?

I just started getting this error when running Orient. Any advise what to do?
2015-11-10 08:09:52:003 INFO OrientDB auto-config DISKCACHE=489MB (heap=491MB os=52,339MB disk=978MB) [orientechnologies]
2015-11-10 08:09:52:111 INFO Loading configuration from: /home/ubuntu/workspace/orient215/config/orientdb-server-config.xml... [OServerConfigurationLoaderXml]
2015-11-10 08:09:52:391 INFO OrientDB Server v2.1.5 (build 2.1.x#r; 2015-10-29 16:54:25+0000) is starting up... [OServer]
2015-11-10 08:09:52:430 INFO Databases directory: /home/ubuntu/workspace/orient215/databases [OServer]
2015-11-10 08:09:52:484 INFO Listening binary connections on 0.0.0.0:2424 (protocol v.32, socket=default) [OServerNetworkListener]Exception in thread "main" java.lang.NegativeArraySizeException
at com.orientechnologies.orient.server.network.OServerNetworkListener.getPorts(OServerNetworkListener.java:113)
at com.orientechnologies.orient.server.network.OServerNetworkListener.listen(OServerNetworkListener.java:305)
at com.orientechnologies.orient.server.network.OServerNetworkListener.<init>(OServerNetworkListener.java:79)
at com.orientechnologies.orient.server.OServer.activate(OServer.java:334)
at com.orientechnologies.orient.server.OServerMain.main(OServerMain.java:41)
Well I deleted this question quickly because I found my own answer. But on second thought if someone else makes a typo in the port specification in orientdb-server-config.xml, then they might find this post useful

404 Error while deploying simple web-app in JBoss AS 6 and JBoss AS 7?

I followed this blog for injecting EJB in REST layer.
Here is the code that I tried deploying in JBOSS AS 6 and 7 using Eclipse:
REST:
package com.example.rest;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
#Stateless
#Path("current")
public class ServiceFacade {
#EJB
ServiceImpl service;
#GET
public String getDate(){
return service.getCurrentDate().toString();
}
}
EJB:
import java.util.Date;
import javax.ejb.Stateless;
#Stateless
public class ServiceImpl {
public Date getCurrentDate(){
return new Date();
}
}
#ApplicationPath("rest")
public class RestApplication extends Application {
}
pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sample.rest</groupId>
<artifactId>restejb</artifactId>
<version>0.0.1-SNAPSHOT</version>
<description>simplet project to test ejb injection in rest</description>
<dependencies>
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<version>1.0.0.Final</version>
<packaging>war</packaging>
<type>pom</type>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
when I access http://localhost:8080/restejb/rest/current, I get 404 page NOT found error.
Here is the log from deployment to JBOSS AS 6:
11:19:23,701 INFO [AbstractJBossASServerBase] Server Configuration:
JBOSS_HOME URL: file:/Users/sridhar1982AQ/Documents/EE7_servers/jboss-6.1.0.Final/
Bootstrap: $JBOSS_HOME/server/default/conf/bootstrap.xml
Common Base: $JBOSS_HOME/common/
Common Library: $JBOSS_HOME/common/lib/
Server Name: default
Server Base: $JBOSS_HOME/server/
Server Library: $JBOSS_HOME/server/default/lib/
Server Config: $JBOSS_HOME/server/default/conf/
Server Home: $JBOSS_HOME/server/default/
Server Data: $JBOSS_HOME/server/default/data/
Server Log: $JBOSS_HOME/server/default/log/
Server Temp: $JBOSS_HOME/server/default/tmp/
11:19:23,706 INFO [AbstractServer] Starting: JBossAS [6.1.0.Final "Neo"]
11:19:27,412 INFO [ServerInfo] Java version: 1.7.0_71,Oracle Corporation
11:19:27,412 INFO [ServerInfo] Java Runtime: Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
11:19:27,413 INFO [ServerInfo] Java VM: Java HotSpot(TM) 64-Bit Server VM 24.71-b01,Oracle Corporation
11:19:27,413 INFO [ServerInfo] OS-System: Mac OS X 10.9.5,x86_64
11:19:27,414 INFO [ServerInfo] VM arguments: -Dprogram.name=JBossTools: JBoss AS 6.x -Xms256m -Xmx768m -XX:MaxPermSize=256m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.endorsed.dirs=/Users/sridhar1982AQ/Documents/EE7_servers/jboss-6.1.0.Final/lib/endorsed -Djava.library.path=/Users/sridhar1982AQ/Documents/EE7_servers/jboss-6.1.0.Final/bin/native -Dlogging.configuration=file:/Users/sridhar1982AQ/Documents/EE7_servers/jboss-6.1.0.Final/bin/logging.properties -Dfile.encoding=UTF-8
11:19:27,483 INFO [JMXKernel] Legacy JMX core initialized
11:19:35,849 INFO [AbstractServerConfig] JBoss Web Services - Stack CXF Server 3.4.1.GA
11:19:36,679 INFO [JSFImplManagementDeployer] Initialized 3 JSF configurations: [Mojarra-1.2, MyFaces-2.0, Mojarra-2.0]
11:19:47,865 WARNING [FileConfigurationParser] AIO wasn't located on this platform, it will fall back to using pure Java NIO. If your platform is Linux, install LibAIO to enable the AIO journal
11:19:48,389 INFO [JMXConnector] starting JMXConnector on host localhost:1090
11:19:48,609 INFO [MailService] Mail Service bound to java:/Mail
11:19:49,990 INFO [HornetQServerImpl] live server is starting with configuration HornetQ Configuration (clustered=false,backup=false,sharedStore=true,journalDirectory=/Users/sridhar1982AQ/Documents/EE7_servers/jboss-6.1.0.Final/server/default/data/hornetq/journal,bindingsDirectory=/Users/sridhar1982AQ/Documents/EE7_servers/jboss-6.1.0.Final/server/default/data/hornetq/bindings,largeMessagesDirectory=/Users/sridhar1982AQ/Documents/EE7_servers/jboss-6.1.0.Final/server/default/data/hornetq/largemessages,pagingDirectory=/Users/sridhar1982AQ/Documents/EE7_servers/jboss-6.1.0.Final/server/default/data/hornetq/paging)
11:19:49,992 INFO [HornetQServerImpl] Waiting to obtain live lock
11:19:50,105 INFO [JournalStorageManager] Using NIO Journal
11:19:50,140 WARNING [HornetQServerImpl] Security risk! It has been detected that the cluster admin user and password have not been changed from the installation default. Please see the HornetQ user guide, cluster chapter, for instructions on how to do this.
11:19:50,468 INFO [FileLockNodeManager] Waiting to obtain live lock
11:19:50,469 INFO [FileLockNodeManager] Live Server Obtained live lock
11:19:51,283 INFO [NettyAcceptor] Started Netty Acceptor version 3.2.3.Final-r${buildNumber} localhost:5445 for CORE protocol
11:19:51,287 INFO [NettyAcceptor] Started Netty Acceptor version 3.2.3.Final-r${buildNumber} localhost:5455 for CORE protocol
11:19:51,290 INFO [HornetQServerImpl] Server is now live
11:19:51,291 INFO [HornetQServerImpl] HornetQ Server version 2.2.5.Final (HQ_2_2_5_FINAL_AS7, 121) [251821f6-c6bb-11e4-9df3-60334b2115c1] started
11:19:51,386 INFO [WebService] Using RMI server codebase: http://localhost:8083/
11:19:51,699 INFO [jbossatx] ARJUNA-32010 JBossTS Recovery Service (tag: JBOSSTS_4_14_0_Final) - JBoss Inc.
11:19:51,711 INFO [arjuna] ARJUNA-12324 Start RecoveryActivators
11:19:51,745 INFO [arjuna] ARJUNA-12296 ExpiredEntryMonitor running at Tue, 10 Mar 2015 11:19:51
11:19:51,903 INFO [arjuna] ARJUNA-12310 Recovery manager listening on endpoint 127.0.0.1:4712
11:19:51,904 INFO [arjuna] ARJUNA-12344 RecoveryManagerImple is ready on port 4712
11:19:51,905 INFO [jbossatx] ARJUNA-32013 Starting transaction recovery manager
11:19:51,933 INFO [arjuna] ARJUNA-12163 Starting service com.arjuna.ats.arjuna.recovery.ActionStatusService on port 4713
11:19:51,934 INFO [arjuna] ARJUNA-12337 TransactionStatusManagerItem host: 127.0.0.1 port: 4713
11:19:51,937 INFO [arjuna] ARJUNA-12170 TransactionStatusManager started on port 4713 and host 127.0.0.1 with service com.arjuna.ats.arjuna.recovery.ActionStatusService
11:19:52,007 INFO [jbossatx] ARJUNA-32017 JBossTS Transaction Service (JTA version - tag: JBOSSTS_4_14_0_Final) - JBoss Inc.
11:19:52,103 INFO [arjuna] ARJUNA-12202 registering bean jboss.jta:type=ObjectStore.
11:19:52,481 INFO [AprLifecycleListener] The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /Users/sridhar1982AQ/Documents/EE7_servers/jboss-6.1.0.Final/bin/native
11:19:52,764 INFO [TomcatDeployment] deploy, ctxPath=/invoker
11:19:53,207 INFO [ModClusterService] Initializing mod_cluster 1.1.0.Final
11:19:53,286 INFO [RARDeployment] Required license terms exist, view vfs:/Users/sridhar1982AQ/Documents/EE7_servers/jboss-6.1.0.Final/server/default/deploy/jboss-local-jdbc.rar/META-INF/ra.xml
11:19:53,308 INFO [RARDeployment] Required license terms exist, view vfs:/Users/sridhar1982AQ/Documents/EE7_servers/jboss-6.1.0.Final/server/default/deploy/jboss-xa-jdbc.rar/META-INF/ra.xml
11:19:53,322 INFO [RARDeployment] Required license terms exist, view vfs:/Users/sridhar1982AQ/Documents/EE7_servers/jboss-6.1.0.Final/server/default/deploy/jms-ra.rar/META-INF/ra.xml
11:19:53,347 INFO [HornetQResourceAdapter] HornetQ resource adaptor started
11:19:53,359 INFO [RARDeployment] Required license terms exist, view vfs:/Users/sridhar1982AQ/Documents/EE7_servers/jboss-6.1.0.Final/server/default/deploy/mail-ra.rar/META-INF/ra.xml
11:19:53,382 INFO [RARDeployment] Required license terms exist, view vfs:/Users/sridhar1982AQ/Documents/EE7_servers/jboss-6.1.0.Final/server/default/deploy/quartz-ra.rar/META-INF/ra.xml
11:19:53,522 INFO [SimpleThreadPool] Job execution threads will use class loader of thread: Thread-2
11:19:53,574 INFO [SchedulerSignalerImpl] Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
11:19:53,575 INFO [QuartzScheduler] Quartz Scheduler v.1.8.3 created.
11:19:53,579 INFO [RAMJobStore] RAMJobStore initialized.
11:19:53,583 INFO [QuartzScheduler] Scheduler meta-data: Quartz Scheduler (v1.8.3) 'JBossQuartzScheduler' with instanceId 'NON_CLUSTERED'
Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.
NOT STARTED.
Currently in standby mode.
Number of jobs executed: 0
Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 10 threads.
Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support persistence. and is not clustered.
11:19:53,583 INFO [StdSchedulerFactory] Quartz scheduler 'JBossQuartzScheduler' initialized from an externally opened InputStream.
11:19:53,583 INFO [StdSchedulerFactory] Quartz scheduler version: 1.8.3
11:19:53,584 INFO [QuartzScheduler] Scheduler JBossQuartzScheduler_$_NON_CLUSTERED started.
11:19:54,133 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'
11:19:54,533 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
11:19:54,715 INFO [xnio] XNIO Version 2.1.0.CR2
11:19:54,733 INFO [nio] XNIO NIO Implementation Version 2.1.0.CR2
11:19:55,100 INFO [remoting] JBoss Remoting version 3.1.0.Beta2
11:19:55,279 INFO [TomcatDeployment] deploy, ctxPath=/
11:19:55,417 INFO [HornetQServerImpl] trying to deploy queue jms.queue.ExpiryQueue
11:19:55,462 INFO [HornetQServerImpl] trying to deploy queue jms.queue.DLQ
11:19:55,508 INFO [service] Removing bootstrap log handlers
11:19:55,616 INFO [org.apache.coyote.http11.Http11Protocol] Starting Coyote HTTP/1.1 on http-localhost%2F127.0.0.1-8080
11:19:55,624 INFO [org.apache.coyote.ajp.AjpProtocol] Starting Coyote AJP/1.3 on ajp-localhost%2F127.0.0.1-8009
11:19:55,625 INFO [org.jboss.bootstrap.impl.base.server.AbstractServer] JBossAS [6.1.0.Final "Neo"] Started in 31s:909ms
11:19:56,100 INFO [org.jboss.web.tomcat.service.deployers.TomcatDeployment] deploy, ctxPath=/restejb
I am checking one of my projects using rest and in the annotation I use a slash / before the resource name both in #ApplicationPath("/rest") as in the rest service `#Path("/current"), so your EJB seems like must be something like:
#Stateless
#Path("/current")
public class ServiceImpl {
#GET
public Date getCurrentDate(){
return new Date();
}
}
And your activator class something like:
#ApplicationPath("/rest")
public class RestApplication extends Application {
}

Tomcat configuration using embedded ActiveMQ JMS

I have Tomcat 7.0.42 and ActiveMQ 5.10 and have added the following resources to my context.xml file:
<Resource
auth="Container"
brokerName="MyActiveMQBrokerXML"
description="JMS Connection Factory"
factory="org.apache.activemq.jndi.JNDIReferenceFactory"
name="jms/ConnectionFactory"
type="org.apache.activemq.ActiveMQConnectionFactory"
useEmbeddedBroker="true"
brokerURL="vm://localhost?brokerConfig=xbean:activemq.xml"
/>
When starting Tomcat via is built-in startup script I get the following in the console out-put.
2015-01-27 09:49:24,064 [localhost-startStop-1] INFO org.apache.activemq.store.kahadb.plist.PListStoreImpl- PListStore:[C:\tomcat\apache-tomcat-7.0.57\bin\acti vemq-data\MyActiveMQBroker\tmp_storage] started
2015-01-27 09:49:24,068 [localhost-startStop-1] INFO org.apache.activemq.broker.BrokerService- Using Persistence Adapter: KahaDBPersistenceAdapter[C:\tomcat\ap ache-tomcat-7.0.57\bin\activemq-data\MyActiveMQBroker\KahaDB]
2015-01-27 09:49:24,471 [localhost-startStop-1] INFO org.apache.activemq.store.kahadb.MessageDatabase- KahaDB is version 5
2015-01-27 09:49:24,491 [localhost-startStop-1] INFO org.apache.activemq.store.kahadb.MessageDatabase- Recovering from the journal ...
2015-01-27 09:49:24,492 [localhost-startStop-1] INFO org.apache.activemq.store.kahadb.MessageDatabase- Recovery replayed 3 operations from the journal in 0.01 seconds.
2015-01-27 09:49:24,663 [localhost-startStop-1] INFO org.apache.activemq.broker.BrokerService- Apache ActiveMQ 5.10.0 (MyActiveMQBroker, ID:Jacob-PC-55865-1422 373764525-0:1) is starting
2015-01-27 09:49:24,707 [localhost-startStop-1] INFO org.apache.activemq.broker.TransportConnector- Connector vm://localhost?brokerConfig=xbean:activemq.xml st arted
2015-01-27 09:49:24,707 [localhost-startStop-1] INFO org.apache.activemq.broker.BrokerService- Apache ActiveMQ 5.10.0 (MyActiveMQBroker, ID:Jacob-PC-55865-1422 373764525-0:1) started
2015-01-27 09:49:24,708 [localhost-startStop-1] INFO org.apache.activemq.broker.BrokerService- For help or more information please see: http://activemq.apache. org
2015-01-27 09:49:24,711 [localhost-startStop-1] ERROR org.apache.activemq.broker.BrokerService- Memory Usage for the Broker (1024 mb) is more than the maximum a vailable for the JVM: 247 mb - resetting to 70% of maximum available: 173 mb
2015-01-27 09:49:24,728 [localhost-startStop-1] WARN org.apache.activemq.broker.BrokerRegistry- Broker localhost not started so using MyActiveMQBroker instead Jan 27, 2015 9:49:24 AM org.apache.catalina.startup.HostConfig deployDirectory
It appears to me that tomcat is not looking for the activemq.xml file or is at least not using it. This exact configuration works if I start tomcat through eclipse, but that is not a viable option for a production system.
I found that if deploying into production you have to use the absolute path to the file to get Tomcat to find the activemq.xml file. Although using the relative path is supposed to work, I could never get it to.
brokerURL="vm://localhost?brokerConfig=xbean:activemq.xml"
Supposedly only works if you've added to 'activemq.xml' to the class path. Note the presence of 'file' in 'xbean:file:/some/path/activemq.xml'.
<Resource id="MyJmsResourceAdapter" type="ActiveMQResourceAdapter">
BrokerXmlConfig = xbean:file:/usr/share/apache-tomee-plus-8.0.0-M1/conf/activemq.xml
ServerUrl = tcp://localhost:61616
</Resource>

OOM during EhCache replication

We have faced with OOM issue during EhCache replication usage.
Memory dump shows us that jgroup related object in the top:
Instance Counts for All Classes (excluding platform)
464012 instances of class org.jgroups.util.Headers
463718 instances of class org.jgroups.protocols.pbcast.NakAckHeader
463512 instances of class [Lorg.jgroups.Header;
462136 instances of class org.jgroups.Message
173509 instances of class org.jgroups.protocols.TpHeader
63301 instances of class com.mongodb.BasicDBObject
Also we see following warnings in log:
2012-08-26 02:05:50,980 INFO [org.jgroups.JChannel] (main) JGroups version:
2.10.0.GA
2012-08-26 02:05:51,569 WARN [org.jgroups.stack.Configurator] (main) TCPPING property down_thread was deprecated and is ignored
2012-08-26 02:05:51,569 WARN [org.jgroups.stack.Configurator] (main) TCPPING property up_thread was deprecated and is ignored
2012-08-26 02:05:51,576 WARN [org.jgroups.stack.Configurator] (main) VERIFY_SUSPECT property down_thread was deprecated and is ignored
2012-08-26 02:05:51,576 WARN [org.jgroups.stack.Configurator] (main) VERIFY_SUSPECT property up_thread was deprecated and is ignored
2012-08-26 02:05:51,584 WARN [org.jgroups.stack.Configurator] (main) NAKACK property down_thread was deprecated and is ignored
2012-08-26 02:05:51,584 WARN [org.jgroups.stack.Configurator] (main) NAKACK property up_thread was deprecated and is ignored
2012-08-26 02:05:51,629 WARN [org.jgroups.stack.Configurator] (main) GMS property join_retry_timeout was deprecated and is ignored
2012-08-26 02:05:51,629 WARN [org.jgroups.stack.Configurator] (main) GMS property shun was deprecated and is ignored
2012-08-26 02:05:51,629 WARN [org.jgroups.stack.Configurator] (main) GMS property down_thread was deprecated and is ignored
2012-08-26 02:05:51,629 WARN [org.jgroups.stack.Configurator] (main) GMS property up_thread was deprecated and is ignored
2012-08-26 02:05:51,734 WARN [org.jgroups.protocols.pbcast.NAKACK] (main) use_mcast_xmit should not be used because the transport (TCP) does not support IP multicasting; setting use_mcast_xmit to false
2012-08-26 02:05:58,539 WARN [org.jgroups.protocols.pbcast.GMS] (main)
join(host_x-17490) sent to host_x-5955 timed out (after 5000 ms), retrying
2012-08-26 02:06:01,601 INFO
[net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProvider] (main) JGroups Replication started for 'EH_CACHE'. JChannel: local_addr=host_x-17490
cluster_name=EH_CACHE
my_view=[host_x-17490|0] [host_x-17490]
Environment:
CentOS release 5.4 (Final)
JBboss-4.2.3 GA
Java: 1.6.0_21
RAM: 8 Gb
Hosts (machines): host_x, host_y
Lib versions that we use:
jgroups-2.10.0.GA.jar
ehcache-jgroupsreplication-1.5.jar
ehcache-core-2.5.0.jar
Configuration of EhCache (ehcache.xml):
<ehcache>
<cacheManagerPeerProviderFactory class="net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory"
properties="connect=TCP(bind_port=7800):
TCPPING(initial_hosts=host_x[7800],host_y[7800];port_range=5;timeout=3000;
num_initial_members=3;up_thread=true;down_thread=true):
VERIFY_SUSPECT(timeout=1500;down_thread=false;up_thread=false):
pbcast.NAKACK(down_thread=true;up_thread=true;gc_lag=100;retransmit_timeout=3000):
pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=false;
print_local_addr=false;down_thread=true;up_thread=true)"
propertySeparator="::" />
<cache name="RECORD_CACHE" maxElementsInMemory="25000" eternal="false"
overflowToDisk="false" memoryStoreEvictionPolicy="LFU" timeToLiveSeconds="900" >
<cacheEventListenerFactory
class="net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory"
properties="replicateAsynchronously=true, replicatePuts=false, replicateUpdates=false,
replicateUpdatesViaCopy=false, replicateRemovals=true" />
</cache>
</ehcache>
We have checked that 7800 port on host_x is available from host_y and vice versa (via telnet).
Could you please help us to detect root if OOM issue here?
We have some assumptions about incorrect configuration of replication - but currently can't define where is error here.
Thank you for any advice or suggestion!
Your JGroups config is completely off !
First of all, it was probably copied from a very old version. Second, STABLE is missing, which means messages will never get garbage collected ! I suggest use tcp.xml or udp.xml from the 2.10 version of JGroups (you're using).