WSO2 implemented the new Distributed Message Broker by developing the WSO2 Message Broker Integrated with Zookeeper & Cassandra.
When we consider distributed systems this is arguably one the technologies involved in a distributed systems are complicated and not easy to understand because distributed systems are hard to program. Testing a distributed system can also be quite intricate. Verifying of the behaviour and impact of code in the system is not that easy and requires a lot of careful thought and planning during the testing phase.
In this blog post first I elaborate WSO2 Message Broker Integrated With Zookeeper & Cassandra
Apache Zookeeper
Zookeeper is a centralized service coordinator where distributed applications synchronize, all of which services that are used by other distributed applications. When we integrate WSO2 MB with Zookeeper MB the distributed application is going to use the services provided by the Zookeeper. Zookeeper determines which node in the ZooKeeper service is alive at any given time and the handling of the node failures. ZooKeeper supports high-availability, therefore all clients making requests receive consistent and immediate data.
Getting started with Apache Zookeeper
Download Apache Zookeeper (http://www.apache.org/dyn/closer.cgi/zookeeper/)
Create a zoo.config file in zookeeper-3.3.5/conf & include below
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
dataDir=/tmp/zookeeper
# the port at which the clients will connect
clientPort=2181
Then locate to bin folder and start Zookeeper server by executing the command “zkServer.sh
start”
In MB instance qpid-config.xml file which locate repository/conf/advanced/ include the Zookeeper host and port configuration
<coordination>
<!-- Apache Zookeeper Host name -->
<ZooKeeperHost>127.0.0.1</ZooKeeperHost>
<!-- Apache Zookeeper port -->
<ZooKeeperPort>2181</ZooKeeperPort>
<!-- Format yyyy-MM-dd HH:mm:ss -->
<ReferenceTime>2012-02-29 08:08:08</ReferenceTime>
</coordination>
Default port for Zookeeper will be “2181”
Configure Cassandra
Download Apache Cassandra from http://cassandra.apache.org/download/
Cassandra will generate several log files that are usefula.there for we need to make create directoryies to include their paths in cassandra.yaml.We create followe directoryies data_file_directories, commitlog_directory, and saved_caches_directory & sure that the paths exist in conf/cassandra.yaml
Create system.log file & include conf/log4j.properties
log4j.appender.R.File=/var/log/cassandra/system.log
Navigate to bin folder and execute sh cassandra -f to start cassandra
There is a configuration in MB instance to have in the distributed cluster details in MB /repository/conf/advanced/qpid-virtualhosts.xml file
<virtualhost>
<name>carbon</name>
<carbon>
<store>
<class>org.wso2.andes.server.store.CassandraMessageStore</class>
<username>admin</username>
<password>admin</password>
<cluster>ClusterOne</cluster>
<host>localhost</host>
<port>9160</port>
</store>
Running WSO2 MB
Download the WSO2 MB
using the export command Set the JAVA_HOME to your Java home
Execute the ./wso2server.sh in CARBON_HOME/bin
Login user name & password as "admin"
When we navigate to
Home-> Manage-> Message Broker Clusters -> Node List we can view Zookeeper ID c
Now Message broker can running, message sender and receiver.It can send messages to that cluster and consume messages from that cluster using sample client.I will come with the code next time
When we consider distributed systems this is arguably one the technologies involved in a distributed systems are complicated and not easy to understand because distributed systems are hard to program. Testing a distributed system can also be quite intricate. Verifying of the behaviour and impact of code in the system is not that easy and requires a lot of careful thought and planning during the testing phase.
In this blog post first I elaborate WSO2 Message Broker Integrated With Zookeeper & Cassandra
Apache Zookeeper
Zookeeper is a centralized service coordinator where distributed applications synchronize, all of which services that are used by other distributed applications. When we integrate WSO2 MB with Zookeeper MB the distributed application is going to use the services provided by the Zookeeper. Zookeeper determines which node in the ZooKeeper service is alive at any given time and the handling of the node failures. ZooKeeper supports high-availability, therefore all clients making requests receive consistent and immediate data.
Getting started with Apache Zookeeper
Download Apache Zookeeper (http://www.apache.org/dyn/closer.cgi/zookeeper/)
Create a zoo.config file in zookeeper-3.3.5/conf & include below
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
dataDir=/tmp/zookeeper
# the port at which the clients will connect
clientPort=2181
Then locate to bin folder and start Zookeeper server by executing the command “zkServer.sh
start”
In MB instance qpid-config.xml file which locate repository/conf/advanced/ include the Zookeeper host and port configuration
<coordination>
<!-- Apache Zookeeper Host name -->
<ZooKeeperHost>127.0.0.1</ZooKeeperHost>
<!-- Apache Zookeeper port -->
<ZooKeeperPort>2181</ZooKeeperPort>
<!-- Format yyyy-MM-dd HH:mm:ss -->
<ReferenceTime>2012-02-29 08:08:08</ReferenceTime>
</coordination>
Default port for Zookeeper will be “2181”
Configure Cassandra
Download Apache Cassandra from http://cassandra.apache.org/download/
Cassandra will generate several log files that are usefula.there for we need to make create directoryies to include their paths in cassandra.yaml.We create followe directoryies data_file_directories, commitlog_directory, and saved_caches_directory & sure that the paths exist in conf/cassandra.yaml
Create system.log file & include conf/log4j.properties
log4j.appender.R.File=/var/log/cassandra/system.log
Navigate to bin folder and execute sh cassandra -f to start cassandra
There is a configuration in MB instance to have in the distributed cluster details in MB /repository/conf/advanced/qpid-virtualhosts.xml file
<virtualhost>
<name>carbon</name>
<carbon>
<store>
<class>org.wso2.andes.server.store.CassandraMessageStore</class>
<username>admin</username>
<password>admin</password>
<cluster>ClusterOne</cluster>
<host>localhost</host>
<port>9160</port>
</store>
Running WSO2 MB
Download the WSO2 MB
using the export command Set the JAVA_HOME to your Java home
Execute the ./wso2server.sh in CARBON_HOME/bin
Login user name & password as "admin"
When we navigate to
Home-> Manage-> Message Broker Clusters -> Node List we can view Zookeeper ID c
Now Message broker can running, message sender and receiver.It can send messages to that cluster and consume messages from that cluster using sample client.I will come with the code next time
No comments:
Post a Comment