Friday, June 10, 2016

How to install RHBASE Package in R

RHBase Package allows R developer to connect Hadoop HBASE to R using Thrift Server. Even Developers can read, write, and modify tables stored in HBase from R. Installation of RHBase Package requires that you first install and build Thrift server. 

So let see how to install HBase thrift server on centos:

  • Before install HBase thrift server, you need to install all required tools, libraries and apache based Thrift compiler on Linux based system.
          sudo yum install automake libtool flex bison pkgconfig gcc-c++ boost-devel libevent-devel zlib-devel python-devel ruby-devel
  • Then Download Thrift tar file, type following command in terminal
  •  Navigate to the directory where tar file is downloaded.
cd Downloads
  •  Unzip the tar file
           sudo tar -xvf thrift-0.9.0.tar.gz
  • Change permissions
           sudo chmod 777 -R thrift-0.9.0
  • Move thrift directory to another location
           sudo mv thrift-0.9.0 /home/cloudera
  •   Enter into thrift directory and configure the environment variables using following commands
           cd thrift-0.9.0
           sudo ./configure
           sudo make
           sudo make install

  •  Now your Thrift installation is completed! To verify that you have successfully installed Thrift just type:
          thrift   -version
  • .Copy thrift libraries from /usr/local/lib to /usr/lib
          sudo cp /usr/local/lib/libthrift.so  /usr/lib
          sudo cp /usr/local/lib/libthrift-0.9.0.so  /usr/lib
  •  Update PKG_CONFIG_PATH in bashrc file  by typing the following command in terminal
          sudo gedit $HOME/.bashrc
  •   Next Verify pkg-config path is correct
                 pkg-config –cflags thrift
  • .          Now  start hbase, Go to hbase directory and type following command
               cd  /home/cloudera/hbase
               bin/start-hbase.sh
  • .         Start thrift server 
        bin/hbase thrift start
  • .         Check thrift server is running or not, go to browser and type, 
                http://localhost:9095/thrift.jsp



         Install rhbase Package in R    

           To install rhbase package first of all we need to download the package.


         Then Set the system environment path in R commander

                 Sys.setenv("PKG_CONFIG_PATH"="/usr/local/lib/pkgconfig")
                 install.packages(“rhbase_1.2.0.tar.gz”,repos=NULL, type=‘source’)
                 library(rhbase)
   
        This way you can install rhbase packages in R


  
  


















No comments:

Post a Comment

Creating Compelling Pie Charts in Looker: A Step-by-Step Guide with Examples

Creating Compelling Pie Charts in Looker: A Step-by-Step Guide with Examples   In the realm of data visualization, pie charts are a clas...