To generate possible visualization(line,charts, etc..) of hadoop data stored in hbase-0.94.7 using crux-aggregation reporting tool.
- Install Java
- Install pseudo-cluster hadoop. Refer https://docs.google.com/document/d/1v-J19xwJn-Pw9F8OCgLn04dqKwYkGIOxyqRAIGpmHk0/edit?pli=1
- Install hbase-0.94.7.Refer https://docs.google.com/document/d/1ohAR8BLLX6b4M7-Rw1zCXtj2MFEYzLXilSkiWg-KNLI/edit?pli=1 I prefer to install hbase-0.94.7 because the tar file required to setup crux can be downloaded from https://github.com/mkamithkumar/crux-tar-for-hbase-0.94.7
- Install Mysql
- Install Apache tomcat. Refer https://gist.github.com/mkamithkumar/5668122
- Login to your mysql in terminal
hduser@Hadoop:~$ mysql -uroot -hlocalhost -p'your_mysql_root_password'
- Create database for crux in MySQL
- Create schema by running ${YOUR_CRUX_HOME}/db/schema.sql file in MySQL prompt,
mysql>create databse crux;
mysql>use crux;
mysql>source ${YOUR_CRUX_HOME}/db/schema.sql
This creates the schema required for saving the report definitions
- If your are using hbase-0.94.7 , then download crux.war and crux.tar from https://github.com/mkamithkumar/crux-tar-for-hbase-0.94.7
- If your using some other version of hbase check whether it is available in https://github.com/sonalgoyal/crux/downloads
- If no other go, buil your own crux.war and crux.tar using Maven
${CRUX_HOME}/
with your MySQL host, port, dbname, testDbName, user and password.
- Download struts2-fullhibernatecore-plugin-2.2.2-GA.jar from http://code.google.com/p/full-hibernate-plugin-for-struts2/downloads/detail?name=struts2-fullhibernatecore-plugin-2.2.2-GA.jar&can=2&q=
- Add the jar file to your local repository by the following steps:Generate crux.jar and crux.tar file:
- In terminal change directory to
${YOUR_CRUX_HOME}/
hduser@Hadoop:~$ cd ${YOUR_CRUX_HOME}
- Run the follwing maven command
hduser@Hadoop:/usr/local/crux-aggregation$ mvn install:install-file -DgroupId=com.google.code -DartifactId=struts2
</br/> - The above will add the truts2-fullhibernatecore-plugin-2.2.2-GA.jar file to your maven repository(by default .m2 directory)
- Now build maven to generate crux.jar and crux.jar file
hduser@Hadoop:/usr/local/crux-aggregation$ mvn install
- Now go to
${YOUR_CRUX_HOME}/target
folder you can find crux.jar and crux.war file - Copy crux.jar to
${YOUR_HBASE_HOME}/lib
- Copy crux.war to
tomcat/webapps
- Start hbase
- Go to
${YOUR_HBASE_HOME}
then enter bin/start-hbase.sh to start hbasehduser@Hadoop:/usr/local/hbase$ sudo bin/start-hbase.sh
- Then start hbase shell by entering hbase shell
hduser@Hadoop:/usr/local/hbase$ sudo bin/hbase shell
- Go to
- Start tomcat
- Go to
${YOUR_CATALINA_HOME}
then enter bin/startup.sh to start tomcat serverhduser@Hadoop:/usr/local/tomcat$ sudo bin/startup.sh
- Now your crux is setup goto http://localhost:8080/crux and define your connection, mapping and report.
- Go to
- Download bse-stock-hadoop-crux-reporting git hub repository and extract it
- Open Eclipse and import BSEStock project into workspace
- Resolve the build path issues by adding all jar files from
${YOUR_HADOOP_HOME}
and${YOUR_HADOOP_HOME}/lib
- Add hbase jar from
${YOUR_HBASE_HOME}
and zookeeper jar from${YOUR_HBASE_HOME}/lib
to project build path - Add the jar files in the dependency folder to your eclipse build path
- Create a table in hbase
- Copy the BSEStockdata.txt file from the dependency folder to HDFS
- Change the input file path in StockDriver.java to your hdfs path of input file
- Run StockDriver.java as Hadoop Job
- Open crux web ui http://localhost:8080/crux
- Give Connection Name as HbaseConnection and HBase Zookeeper Location as localhost:2181
- Add a mapping by clicking Mapping link with Mapping Name as BSEStockMapping(or your girlfriend's name)
- Add Row Key Alias
<ol> <li><em>Alias:</em> <b>stockId</b><br/><em>Length:</em> <b>6</b><br/><em>Value Type:</em> <b>String</b></li> <li><em>Alias:</em> <b>date</b><br/><em>Length:</em> <b>8</b><br/><em>Value Type:</em> <b>Long</b></li> </ol> </li> <li>Add Column Alias <ol> <li><em>Column Family:</em> <b>price</b><br/><em>Qualifier:</em> <b>close</b><br/><em>Alias:</em> <b>closePrice</b><br/><em>Value Type:</em> <b>Float</b></li> <li><em>Column Family:</em> <b>price</b><br/><em>Qualifier:</em> <b>open</b><br/><em>Alias:</em> <b>openPrice</b><br/><em>Value Type:</em> <b>Float</b></li> <li><em>Column Family:</em> <b>price</b><br/><em>Qualifier:</em> <b>low</b><br/><em>Alias:</em> <b>lowPrice</b><br/><em>Value Type:</em> <b>Float</b></li> <li><em>Column Family:</em> <b>price</b><br/><em>Qualifier:</em> <b>high</b><br/><em>Alias:</em> <b>highPrice</b><br/><em>Value Type:</em> <b>Float</b></li> </ol> </li> <li>After adding Row Key and Column Aliases save this mapping.</li> <li> Add Report by Clicking Report link with <em>Report Name</em> as <b>BSEStock report<b>(or your second girlfriend's name) </li> <li> Select the mapping your have saved just now from the Mapping drop down</li> <li> Select your desired Report Type and Reap the fruit of this project. Enjoy have fun..!!!</li> <li>All info above are taken from http://nubetech.co/crux-visualizing-and-querying-big-data-saved-in-hbase</li>
hbase(main):006:0> create 'stockDataComposite','price'
hadoop dfs -copyFromLocal $HOME/Downloads/BSEStockData.txt hdfs://localhost:54310/user/hduser/projects/input/bsestock