[ Documentation Index ]

Starting external zoo keeper server and use the inbuilt cassandra server in ring model with broker nodes

In this model you need to get downloaded following apache product

Deployment model will be like bellow

Cluster Setup Scenario 02

In this model we have a common zoo keeper server. Since we are shipping a cassandra server with Message broker product we can use that and create a cassandra ring in the cluster.

  • Zoo Keeper Server - 192.168.0.100

We have three Message Broker servers in three different hosts as and all of them are having a cassandra server in it

  • MB Server 01 - 192.168.0.101
  • MB Server 02 - 192.168.0.102
  • MB Server 03 - 192.168.0.103

We need to configure cassandra servers in these MB servers to form a cassandra ring. For that we need to change the following entries in the "Cassandra.yaml" file which is located in the "wso2mb-2.0.1/repository/conf/etc" directory.

  • Change the seeds in the ring. You can get a better idea on setting a cassandra from following web page. Here we are configuring two seed nodes. (MB Server 01 and 02)
  •               # seeds is actually a comma-delimited list of addresses.
                  # Ex: "<ip1>,<ip2>,<ip3>"
                  - seeds: "192.168.0.101,192.168.0.102"
    
              
  • Change listen address of the server. By default it is "localhost", change it to the ip address of the host where you have the cassandra server. You need to change the listen address of the each server to it's ip address. Here for the server 192.168.0.102, it will like bellow.
  •              listen_address: 192.168.0.102
              
  • Change RPC address of the server.By default it is "localhost", change it to the ip address of the host where you have the cassandra server. You need to change the RPC address of the each server to it's ip address. Here for the server 192.168.0.103, it will like bellow.
  •              rpc_address: 192.168.0.103
              

Then we need to configure the Zoo Keeper Server to listen to all broker nodes. We can do it by renaming the "zoo_sample.cfg" file which can be found at "zookeeper-3.3.4/conf" folder to "zoo.cfg" and do the following modification in that file

  • Change the data directory to store data local to the installation directory
  • Add the entry "clientPortAddress" by providing the ip of the localhost

After modifying the file , it will look like bellow.

            # 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=./../data
            # the port at which the clients will connect
            clientPort=2181

            clientPortAddress=192.168.0.100
        

Once you done the above changes, you can save the file and start the zookeeper server by executing the "zkServer.sh" script with the option start. eg: sh zkServer.sh start

Then you need to do the following configuration changes in each Message broker nodes

Modify qpid-config.xml file which is located at : /repository/conf/advanced directory as bellow

  • Enable clustering
  • Change the server of the Zookeeper
          <clustering>

          <enabled>true</enabled>
          <OnceInOrderSupportEnabled>false</OnceInOrderSupportEnabled>
          <externalCassandraServerRequired>false</externalCassandraServerRequired>

          <coordination>
              <!-- Apache Zookeeper Address -->
              <ZooKeeperConnection>192.168.0.100:2181</ZooKeeperConnection>
              <!-- Format yyyy-MM-dd HH:mm:ss -->
              <ReferenceTime>2012-02-29 08:08:08</ReferenceTime>
          </coordination>
      

Now you can start all three Message Broker nodes.

Other Resources

The WSO2 Oxygen Tank Library : The Library contains articles, tutorials, presentations, and other knowledge base items published on The Oxygen Tank on different styles of deployments.