Posts

Showing posts from 2013

Setting up a local 3 node Cassandra cluster on single machine

When trying to create a Cassandra cluster for a small test scenario i came across the fact that it is not possible to create a cluster in a single machine by changing ports. Since i didn't want to set it up on several machines did some digging and with some help found a workaround for this.

The workaround is to add virtual Ethernet devices to our machine and use these to configure the cluster. So first we need to create 3 ip aliases for our machine, you can use the following command to get this done. This is for a Linux machine check out the stack overflow thread to check how its done on windows here

ifconfig eth0:1 192.168.0.2ifconfig eth0:2 192.168.0.3ifconfig eth0:3 192.168.0.4 you can check if the aliases are created by executing 'ifconfig'.

once you have this setup all you have to do is configure the Cassandra configurations. You need to change the values of the following entries cassandra.yaml file as follows

Node 1:
- seeds: "192.168.0.2" listen_address: 192…

Simple log analysis with Apache Spark

Image
In this post we will try to learn to run some simple commands with Spark, some simple transformations and actions. We will do some simple log analysis using Spark. I will be using the local Spark cluster that i setup on my laptop. if you haven't read my first post on how to setup an Spark cluster on your local machine i recommend you read the post How to set up a Apache Spark cluster in your local machine. First we will connect the the cluster with the following command.

MASTER=spark://pulasthi-laptop:7077 ./spark-shell
"spark://pulasthi-laptop:7077" is the URL of the master that can be found in the Spark web ui. After connecting successfully you should be able to see an Scala console where you can execute commands. Also you should be able to see your application listed in the web-ui under running applications. To run this scenarios i am using a set of log files generated from various WSO2 products as sample data. Any set of log files or even just a set of text file shou…

How to set up a Apache Spark cluster in your local machine

Image
The past few days i grew some interest in Apache Spark and thought of playing around with it a little bit. If you haven't heard about it go an take a look its a pretty cool project it claims to be around 40x faster than Hadoop in some situation. The incredible increase in performance is gained by leveraging in-memory computing technologies. I want go into details about Apache Spark here if you want to get a better look at Spark just check out there web site - Apache Spark.

In this post we will be going through the steps to setup an Apache Spark cluster on your local machine. we will setup one master node and two worker nodes. If you are completely new to Spark i recommend you to go through First Steps with Spark - Screencast #1 it will get you started with spark and tell you how to install Scala and other stuff you need.

We will be using the  launch scripts that are provided by Spark to make our lives more easier. First of all there are a couple of configurations we need to set.

c…

WSO2 Governance Registry - Lifecycle Management Part 2 - Transition Validators

This is the second post of "WSO2 Governance Registry - Lifecycle Management" post series. In the first post - Part 1 - Check Items we gave a small introduction to lifecycle management in WSO2 Governance Registry and looked at how check items can be used and did a small sample on that. 
In this post we will look at Transition Validators as mentioned in the previous post. As mentioned in part 1 transition validations can be used within check items and it can also be used separately ( All the validators will be called only during a state transition, checking a check item will not call the validator ). we will take a look at the same config this time with two transition validation elements.
<aspect name="SimpleLifeCycle" class="org.wso2.carbon.governance.registry.extensions.aspects.DefaultLifeCycle"> <configuration type="literal"> <lifecycle> <scxml xmlns="http://www.w3.org/2005/07/scxml" …

How to revert all the local changes in SVN

When working with SVN now and then you will need to revert changes that was done by you or by applying a patch. Recently i wanted to revert all the changes done locally and found a nice command that can get this done :). Thanks goes to the original poster here.

svn st -q | awk '{print $2;}' | xargs svn revert
Hope this helps someone who is looking for the same functionality.

WSO2 Governance Registry - Lifecycle Management Part 1 - Check Items

The Lifecycle Management(LCM) plays a major role in SOA Governance. The default LCM supported by the WSO2 Governance Registry allows users to promote and demote life cycle states of a given resource. Furthermore, it can be configured to use checklists as well check out the documentation here.

The Lifecycle configuration templates allows advance users to extend its functionality through 6 data elements which are listed below
check itemstransition validationstransition permissionstransition executionstransition UItransition scriptsBellow is the full template of the lifecycle configuration. in this article series we will take a look at each item and see how they can be used to customize lifecycle management in WSO2 Governance Registry. In this article we will look at check items.

check items
Check items allow you to define a list, ideally an check list that can be used to control changes in lifecycle states and make sure specific requirements are met before the lifecycle is changed to the ne…

How to define XSD to allow any XML element as child element

While working on a new feature for WSO2 GREG i came across a requirement  to allow any arbitrary XML element to be passed as a child element and i needed to define this in an XSD file. After a bit of searching and some help i was able to find the correct XSD structure for this and thought i might be helpful to share it

<xs:element maxoccurs="unbounded" minoccurs="0" name="parameter"> <xs:complextype> <xs:sequence> <xs:any maxoccurs="unbounded" minoccurs="0" processcontents="skip"> </xs:any></xs:sequence> <xs:attribute name="name" type="xs:string" use="optional"> <xs:attribute name="value" type="xs:string" use="optional"> </xs:attribute></xs:attribute></xs:complextype> </xs:element>
The given XSD will allow an XML such as the example given below

<parameter name=…