Sunday, May 31, 2015

Installing Apache HBase on Windows 8 using Cygwin64 (without Hadoop)

DOWNLOADS:

1. Download Java 7 (jdk-7u1-windows-i586.exe), HBase Stable binary (hbase-1.0.1.1-bin.tar.gz) and Cygwin64 (setup-x86_64.exe)

JAVA:

2. Install Java in default location (with default options)

3. Configure Environment variables for JAVA_HOME, PATH and CLASSPATH.

CYGWIN64:

4. Create folders as below:
C:\cygwin\root // Root folder
C:\cygwin\setup // Local Package folder

5. Place Cygwin64 setup file inside Local Package folder

6. Run setup with Install from Internet options without selecting any additional packages

7. Configure Environment variables for CYGWIN_HOME (C:\cygwin\root) and PATH (%CYGWIN_HOME%\bin)

8. Re-run setup with default options and select the below packages during installation:
a. OpenSSH
b. tcp_wrappers
c. diffutils
d. zlib

HBASE:

9. Place hbase-*.tar.gz inside C:\cygwin\root\usr\local folder

10. Unpack the archive using Cygwin64 terminal
$ tar xvf hbase-1.0.1.1-bin.tar.gz

11. Create logs folder i.e. C:\cygwin\root\usr\local\hbase-1.0.1.1\logs

12. Add the following to hbase-site.xml


hbase.rootdir
file:///C:/cygwin/root/tmp/hbase/data
 
hbase.tmp.dir
C://cygwin/root/tmp/hbase/tmp
 
hbase.zookeeper.quorum
127.0.0.1



13. Add the following to hbase-env.sh

export JAVA_HOME=/usr/local/zulu/
export HBASE_CLASSPATH=/cygwin/root/usr/local/hbase-1.0.1.1/lib/
export HBASE_OPTS="-XX:+UseConcMarkSweepGC"
export HBASE_IDENT_STRING=$HOSTNAME

LINKS & FILE PERMISSIONS:

14. Create Symbolic Link for Java using Cygwin64 terminal
$ LN -s /cygdrive/c/Azul/zulu1.7.0_65-7.6.0.1-win64 /usr/local/zulu

15. Create passwd and group files inside /etc folder:
C:\cygwin\root\etc\passwd
C:\cygwin\root\etc\group

16. Set file permissions:
chmod +r /etc/passwd
chmod u+w
chmod +r /etc/group
chmod u+w /etc/group
chown :Users /var
chmod 757 /var
chmod ug-s /var
chmod +t /var

SSH CONFIGURATION:

17. Configure SSH using Cygwin64 terminal [Run As Administrator]:
A. Run the script
$ ssh-host-config
(Refer: Installing Apache HBase (TM) on Windows using Cygwin)

B. Start the SSH service
$ net start sshd

C. Harmonize Windows and Cygwin64
$ mkpasswd -cl > /etc/passwd
$ mkgroup --local > /etc/group

18. Test SSH using another Cygwin64 terminal [Local User]:

$ ssh cyg_server@localhost
cyg_server@localhost's password:

cyg_server@aravindpc ~
$ logout

TROUBLESHOOTING:

$ editrights -l -u aravindpc
$ editrights.exe -a SeAssignPrimaryTokenPrivilege -u aravindpc
$ editrights.exe -a SeCreateTokenPrivilege -u aravindpc
$ editrights.exe -a SeTcbPrivilege -u aravindpc
$ editrights.exe -a SeServiceLogonRight -u aravindpc

$ ssh-keygen -R localhost

REFERENCES:

1. http://hbase.apache.org/cygwin.html
2. https://hbase.apache.org/0.94/book.html

1 comment: