Before tossing for a few days, want to let HBase's stand-alone mode on the Cygwin run up, are unsuccessful. As I was discouraged, I stumbled upon the hbase0.96.0 bin and the Conf directory with some files with the extension cmd. Is this for Windows? Can hbase now run directly on Windows? With this idea, I tried to run HBase without Cygwin, and it really worked. Record it and make a reference to the person in need.
1. Environment:
Win7 64bit
Jdk1.6.0_43 64bit
Hbase-0.96.0-hadoop1
Yes, I don't need cygwin.
Comparing the new HBase version is natively supported for Windows, and at least supports standalone mode.
2. Download
I downloaded the hbase-0.96.0-hadoop1-bin.tar.gz and unzipped it.
3. Configure Conf/hbase-site.xml
XML code
- <configuration>
- <property>
- <name>hbase.rootdir</name>
- <value>file:///c:/cygwin64/tmp/hbase/root</value>
- </Property>
- <property>
- <name>hbase.tmp.dir</name>
- <value>c:/cygwin64/tmp/hbase/tmp</value>
- </Property>
- <property>
- <name>hbase.zookeeper.quorum</name>
- <value>127.0.0.1</value>
- </Property>
- <property>
- <name>hbase.zookeeper.property.datadir</name>
- <value>c:/cygwin64/tmp/hbase/zoo</value>
- </Property>
- <property>
- <name>hbase.cluster.distributed</name>
- <value>false</value>
- </Property>
- </configuration>
The 3 directories mentioned in the configuration file are not created manually, and are created automatically the first time.
4. Go directly to the Windows CMD command line and start HBase standalone mode
Text Code
- Start-hbase.cmd
5. Test HBase Shell
D:\opensource\hadoop\hbase-0.96.0-hadoop1\bin>hbase Shell
HBase Shell; Enter ' help<return> ' for list of supported commands.
Type "exit<return>" to leave the HBase Shell
Version 0.96.0-hadoop1, r1531434, Fri Oct 15:11:29 PDT 2013
HBase (main):001:0> create ' mytable ', ' data '
0 row (s) in 1.1420 seconds
= Hbase::table-mytable
HBase (main):002:0> put ' mytable ', ' row1 ', ' data:1 ', ' value1 '
0 row (s) in 0.0580 seconds
HBase (main):003:0> put ' mytable ', ' row2 ', ' data:2 ', ' value2 '
0 row (s) in 0.0090 seconds
HBase (main):004:0> put ' mytable ', ' row3 ', ' data:3 ', ' value3 '
0 row (s) in 0.0080 seconds
HBase (main):005:0> list
TABLE
MyTable
1 row (s) in 0.0200 seconds
= = ["MyTable"]
HBase (main):006:0> scan ' mytable '
ROW Column+cell
Row1 column=data:1, timestamp=1416554699558, value=value1
Row2 column=data:2, timestamp=1416554715456, value=value2
Row3 Column=data:3, timestamp=1416554730255, Value=value3
3 row (s) in 0.0520 seconds
HBase (main):009:0> exit
Test everything OK, very perfect. No need for Cygwin. It's also a surprise for HBase.
6. Supplement: Another way to operate under the Cygwin
Then inadvertently tried to run under the Cygwin, forgot to open sshd, but succeeded.
My god! Open sshd instead of error??!
The beta version is also HBASE-0.96.0-HADOOP1
OK, the only point is to remember to close sshd.
And hbase-env.sh is definitely going to change.
Java code
- Export JAVA_HOME=/CYGDRIVE/C/JDK1. 7.0_67
- Export hbase_classpath=/cygdrive/d/opensource/hadoop/hbase-0.96. 0-hadoop1/lib/zookeeper-3.4. 5.jar
- Export hbase_manages_zk=true
Then start hbase before starting to clear the log and TMP directories to avoid interference.
There is a failure to connect to port 22 at startup, and it runs slowly, but don't panic, please continue.
$./bin/start-hbase.sh
127.0.0.1:ssh:connect to host 127.0.0.1 Port 22:connection refused
Starting master, logging to/cygdrive/d/opensource/hadoop/hbase-0.96.0-hadoop1/bin/. /logs/hbase-pchen4-master-w-shdc-pchen4.out
Localhost:ssh:connect to host localhost Port 22:connection refused
Test the shell below
There is a problem with no prompt, and the first command has to wait a long time to respond. Yes, do not panic, do not think that death, I am waiting on the machine for about 2, 3 minutes (see below the scarlet Letter), after the miracle appeared. The commands in the back are normal.
$./bin/hbase Shell
HBase Shell; Enter ' help<return> ' for list of supported commands.
Type "exit<return>" to leave the HBase Shell
Version 0.96.0-hadoop1, r1531434, Fri Oct 15:11:29 PDT 2013
List
List
TABLE
0 row (s) in 154.4250 seconds
[]
Create ' mytable ', ' data '
Create ' mytable ', ' data '
0 row (s) in 0.3510 seconds
Hbase::table-mytable
List
List
TABLE
MyTable
1 row (s) in 0.0150 seconds
["MyTable"]
Scan ' mytable '
Scan ' mytable '
ROW Column+cell
0 row (s) in 0.0280 seconds
It was a fluke, but it was too slow, so I guess no one would use it.
Hey, all right. This hbase is too frustrating, do not want to trouble, or use Linux it. That's it.
hbase0.96.0 stand-alone mode installation (Win7 without Cygwin)