activemq master / slave structure configuration analysis
Advertisements
First, memory backup, the system downtime, the original data is lost, the configuration file as follows:
master broker configuration file, without any particular place, is a standard broker configuration.
<Beans
xmlns = " http://www.springframework.org/schema/beans "
xmlns: xsi = " http://www.w3.org/2001/XMLSchema-instance "
xsi: schemaLocation = " http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd ">
<bean/>
<Broker brokerName = "Master" xmlns = " http://activemq.apache.org/schema/core ">
<transportConnectors>
<transportConnector uri="tcp://localhost:62001"/>
</ TransportConnectors>
</ Broker>
</ Beans>
slave broker configuration file, the red part is very important that the composition of a backup and a master of structure, under normal circumstances, the slave is in standby status, problems arise when the master, slave to working condition.
<Beans
xmlns = " http://www.springframework.org/schema/beans "
xmlns: xsi = " http://www.w3.org/2001/XMLSchema-instance "
xsi: schemaLocation = " http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd ">
<bean/>
<Broker brokerName = "slave" shutdownOnMasterFailure = "false" masterConnectorURI = "TCP: / / localhost: 62,001" xmlns = " http://activemq.apache.org/schema/core ">
<managementContext>
<managementContext createConnector="true" connectorPort ="1098"/>
</ ManagementContext>
<transportConnectors>
<transportConnector uri="tcp://localhost:62002"/>
</ TransportConnectors>
</ Broker>
</ Beans>
Second, use shared file configure master / slave structure:
1, by default, activemq start is to use file as the persistent storage, so when the two broker on the same server on startup,
Not the case with persistenceAdapter that file sharing type of mutual support mechanism.
2 can be configured to share files using persistenceAdapter location, when the broker starts a different server,
To form a mutual support mechanism.
Two profiles, except transportationConnector inconsistent, other things being equal:
<Beans
xmlns = " http://www.springframework.org/schema/beans "
xmlns: xsi = " http://www.w3.org/2001/XMLSchema-instance "
xsi: schemaLocation = " http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd ">
<bean/>
<Broker brokerName = "shared" xmlns = " http://activemq.apache.org/schema/core ">
<! -
In the default case, activemq start is to use file as the persistent storage, so when the two broker on the same server on startup,
Not the case with persistenceAdapter that file sharing type of mutual support mechanism.
Can be configured to share files using persistenceAdapter location, when the broker starts a different server,
To form a mutual support mechanism.
->
<persistenceAdapter>
<journaledJDBC dataDirectory="/sharedFileSystem/broker"/>
</ PersistenceAdapter>
<transportConnectors>
<transportConnector uri="tcp://localhost:62001"/>
</ TransportConnectors>
</ Broker>
</ Beans>
Third, use of database backup and file backup mechanism is basically the same.
Related Posts of activemq master / slave structure configuration analysis
-
The EJB3 Persistence
EJB3 persistence with Hibernate is very similar to the mechanism: Environment: Server: JBOSS5.0 Database: MySQL5.0 1. Set up a data source First of all, in jboss-5.0.0.GA \ server \ default \ deploy, the establishment of a database used to connect the dat
-
hibernate generic generic DAO
package org.lzpeng.dao; import java.io.Serializable; import java.util.List; import org.hibernate.Criteria; import org.hibernate.Query; import org.hibernate.criterion.Criterion; import org.springside.modules.orm.hibernate.Page; /** * * @version 2009-1-10 *
-
Servlet brief introduction
Servlet brief introduction: Servlet is a small application server Are used to complete the B / S architecture, the client requests the response to treatment Platform independence, performance, able to run thread Servlet API for Servlet provides the s ...
-
Spring2.0 + hibernate3.1 + log4j + mysql demo
applicationContext.xml Non-attachment jar package, necessary friends can send an email to todd.liangt @ gmail.com
-
Struts2 + hibernate + spring problem user log in
dao layer services layer action jsp <tr> <td align="center"> <b> user name: </ b> </ td> <td> <s: textfield name = "czyNumber" cssClass = "textstyle" theme = "simple" size = &q
-
Hibernate secondary cache
Hibernate cache: 2-bit cache, also known as process-level cache or SessionFactory level cache, secondary cache can be shared by all of the session Cache configuration and the use of: Will echcache.xml (the document code in hibernate package directory ...
-
Hibernate's lazy strategy
hibernate Lazy strategy can be used in: <class> tag, it can be true / false Tags can <PROPERTY> values true / false type of necessary tools to enhance <set> <list> can tag values true / false / extra <many-to-one> <on ...












