Wednesday, February 19, 2014

Install Apache Spark and Fast Log Analytics

Spark is cool and fast tool, the processing layer over the top Hadoop HDFS.
I try this after installation and it really fast by advanced caching and scheduling jobs in distributed computation system.
In  this example, I try a counting the number of IP "" in access log / month(12 MB)

Testing Apache Spark 
Installing Apache Spark only involves some simple steps including the  
  1. Install Java
  2. Install Hadoop
  3. Install Scala
  4. Install Spark
Install Java on Ubuntu
Java can be installed as shown on this howto:
  • sudo add-apt-repository ppa:webupd8team/java 
  • sudo apt-get update
  • sudo apt-get install oracle-java7-installer
After installation, you can test if it works by typing java -version at the command prompt. This should give you the java version.

Install Hadoop on Ubuntu
  • Hadoop can simply be installed by downloading a .deb file:
  • go to and choose a mirror
  • choose a Hadoop version you prefer (i have chosen hadoop-1.2.1)
  • download your .deb file (i have chosen hadoop_1.2.1-1_x86_64.deb)
When opening it, the Ubuntu Software Center opens to install it.
After installation, you can see if it works by typing hadoop at the command prompt. It should give you some information about using the hadoop command.

After installing Hadoop, lookup /etc/hadoop/ and change the line:
 export JAVA_HOME=/usr/lib/jvm/java-6-sun
 #export JAVA_HOME=/usr/lib/jvm/java-6-sun

Install Scala on Ubuntu
Follow the steps as presented on this page: 
Download Scala from and save it somewhere you can find it (e.g. ~/)
at the command prompt, type:
  • cd /usr/share
  • sudo tar -zxf <location and name of the tgz file> (e.g. sudo tar -zxf ~/scala-2.10.3.tgz)
  • link (ln -s) the executables to the /usr/bin location, e.g.:
  • sudo ln -s /usr/share/scala-2.10.3/bin/scala /usr/bin/scala
  • sudo ln -s /usr/share/scala-2.10.3/bin/scalac /usr/bin/scalac
  • sudo ln -s /usr/share/scala-2.10.3/bin/fsc /usr/bin/fsc
Installing Spark on Ubuntu
  • Getting Spark up and running is easy as described on 
  • Goto and download Spark.
  • Unpack it at a preferred location
  • Go to your Spark home directory in a terminal and type: sbt/sbt assembly
  • You can start spark by executing ./spark_shell in the spark home 
Note: log4j is still configured in such a way that all logging messages occur in your main window. You can redirect the messages to a standard log file by creating a file log/ with the following content:
log4j.rootLogger = DEBUG, A1
log4j.appender.A1.MaxFileSize = 100KB
log4j.appender.A1.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n

# Ignore messages below warning level from Jetty, because it's a bit verbose

Now you are ready to make some Sparks

Tuesday, February 18, 2014

new tools for reactive => creative big data

My ideas from some Open Source Projects, that make the World of big data more real-time, more cool, accessible and usable.
Just "connecting the dots" and create a new tool

  • Reactive Functor Framework / Platform (aka: Rfx Framework)

Goals (RFVA):
  • Reactive to data with logic rules , fuzzy-logic rules (RxSQL) and stream algorithms
  • Full Stack (backend+frontend) real-time big data framework
    • Backend: Data Crawler + Kafka + Netty + Redis + Hadoop Tools
    • Frontend: Groovy + AngularJS + D3 + Bootstrap
  • Visualize data with Accessibility and Usability (D3.js)
  • Agent-based Processing (Akka): social network simulation problems

Targeting to:
  • Big Data Developers
  • Data Scientists
  • Data Analysts
  • All users, who want to play with stream data science in social network

Problems & Domains:
  • Social Media Research (Facebook Graph + News) for data-driven marketing
  • Humanity issues (data science)
  • Social Science (Classical Statistics with stream data from news, social data)
  • Real-time Data-Driven Business
  • Time series data visualization

Wednesday, February 12, 2014

Reactive Real-time Big Data System at

what I will cover at
vote for me my topic at

The mission "Help developers and data scientists take the opportunity to build a reputation as the creator of new information experiences"

The story of “Reactive Real-time Big Data System”

Concepts, Implementations & Practices

The story of “Reactive Real-time Big Data System”
Concepts, Implementations & Practices
This story is about:
  1. Reactive
  2. Real-time
  3. Big Data
  4. System
  5. Our small worlds
Breaking down stories into sub-stories:
  1. Short history, how big data is born
  2. Problems, what’s the issues ?
  3. Demands: what do we need ?
  4. Dreams: what do we dream about ?
  5. Supply: Solutions (Frameworks, Patterns, Platforms, Best Practices)
  6. Realtime Data-Driven Business
Real story (a non-fiction story about Data-Driven Marketing):
  • The small world of Flappy Bird with Active Functor Framework
    • subscribe *  from Article where title contains ['Flappy Bird'] and facebook's stats (like + share + comment) > 1000
    • subscribe *  from my Facebook’s Feeds where my facebook’s friends shared and domain contains [‘’] or title contains [‘caffee’]
    • subscribe *  from Article where i could like and category in [‘big data’, ‘computer’,’mobile’]
    • subscribe *  from my Facebook’s Feeds where my facebook’s friends shared and title contains ‘Fast and furious’
    • subscribe, visualize places from my Facebook’s Feeds where i and my wife took photos
What’s next ?

Thursday, February 6, 2014

Harnessing the Power of Big Data for Media (Journalism/Content)

Mainstream media and the distribution of news

Discovering Company Revenue Relations from News: A Network Approach

Real Time News Analysis for Improved Social Relationship Discovery

Semi-supervised Statistical Inference for Business Entities Extraction and Business Relations Discovery

my improvements for Apache Kafka

What I can do:

  • upgrade & compile OK with latest version Scala 2.10.3
  • notify when Kafka's producer writer is finished, means it should be faster 
  • real-time indexing & search  Kafka message & offset using Apache Lucene
  • real-time monitoring & alert using Redis
here the first try after a hacked day:

Reactive Real-time Big Data with Open Source Lambda Architecture Stack

5 Why

1) Why "Reactive" ?
  • react to events
  • react to load
  • react to failure
  • react to users
2) Why "Real-time"?
3) Why "Big Data" ?
4) Why "Open Source" ? 
Security, Quality, Customizability, Freedom, Flexibility, Interoperability, Auditability, Support Options, Cost, Try Before You Buy

5) Why Lambda Architecture ?

The list of open source framework/tools I have tried:

● Netty ( a framework using reactive programming pattern for scaling HTTP system easier, by JBoss

● Apache Kafka ( a publish-subscribe messaging rethought as a distributed commit log, open sourced by Linkedin.

● Storm ( the framework for distributed realtime computation system, by Twitter

● Akka (Actor Model), a toolkit and runtime for building highly concurrent, distributed, and fault tolerant event-driven applications on the JVM. 
More use cases at

● Redis ( a advanced key-value in-memory NoSQL database, all fast statistical computations in here.

● OrientDB, an Open Source NoSQL DBMS with the features of both Document and Graph DBMSs for KPI Report Data Management

● Groovy and Grails for scripting layer on JVM, ad-hoc query on Redis, and the front-end

● Hadoop ecosystem : HDFS, Hive, HBase for batch processing

● RxJava a library for composing asynchronous and event-based programs

● Hystrix : for Latency and Fault Tolerance for Distributed Systems

● NVD3 Reusable D3 Chart