Este contenido no está disponible en el idioma seleccionado.
3.2. Shared JDBC Master/Slave
Overview Copiar enlaceEnlace copiado en el portapapeles!
- The shared database is a single point of failure. This disadvantage can be mitigated by using a database with built in high availability(HA) functionality. The database will handle replication and fail over of the data store.
- You cannot enable high speed journaling. This has a significant impact on performance.
Initial state Copiar enlaceEnlace copiado en el portapapeles!
Figure 3.4. JDBC Master/Slave Initial State
After failure of the master Copiar enlaceEnlace copiado en el portapapeles!
Figure 3.5. JDBC Master/Slave after Master Failure
Configuring the brokers Copiar enlaceEnlace copiado en el portapapeles!
Example 3.3. JDBC Master/Slave Broker Configuration
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:amq="http://activemq.apache.org/schema/core"
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">
<broker xmlns="http://activemq.apache.org/schema/core"
brokerName="brokerA">
...
<persistenceAdapter>
<jdbcPersistenceAdapter dataSource="#oracle-ds"/>
</persistenceAdapter>
...
</broker>
<bean id="oracle-ds"
class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
<property name="url" value="jdbc:oracle:thin:@localhost:1521:AMQDB"/>
<property name="username" value="scott"/>
<property name="password" value="tiger"/>
<property name="poolPreparedStatements" value="true"/>
</bean>
</beans>
Configuring the clients Copiar enlaceEnlace copiado en el portapapeles!
broker1, broker2, and broker3.
Example 3.4. Client URL for a Shared JDBC Master/Slave Group
failover:(tcp://broker1:61616,tcp://broker2:61616,tcp://broker3:61616)
Reintroducing a failed node Copiar enlaceEnlace copiado en el portapapeles!
Figure 3.6. JDBC Master/Slave after Master Restart