因hbase是在linux或者是在unix环境下运行的。所以在windows环境下安装hbase,需要先安装一个可以虚拟unix或者linux的工具。然后通过这个工具虚拟的虚拟机来启动和访问hbase。在这里使用的是cygwin。
1.安装cygwin
在这个页面选择“install from Local Directory”。
2.安装hbase
1.将“hbase-1.2.6-bin.tar.gz”解压
2.配置hbase-1.2.6\conf\hbase-env.sh
这两个变量配置的值中前面的“/cygdrive/”是固定值。是cygwin启动后所虚拟的虚拟机的跟目录。后面的路径则是windows下的绝对路径,如果是在windows下的地址是“C:\Program Files\Java\jdk1.7.0_80\”,则在cygwin虚拟机下访问的地址则为“/cygdrive/c/Program Files/Java/jdk1.7.0_80/”。
3.配置hbase-1.2.6\conf\hbase-site.xml
<?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <!-- /** * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ -->
<configuration> <property> <name>hbase.rootdir</name> <value>/cygdrive/C/cygwin64/tmp/hsperfdata_asus/hbase</value> </property> <property> <name>hbase.tmp.dir</name> <value>/cygdrive/C/cygwin64/tmp/hsperfdata_asus</value> </property> <property> <name>hbase.zookeeper.quorum</name> <value>127.0.0.1</value> </property> </configuration> |
4.基本的shell命令。启动cygwin。