hbase-0.94スクリプトhbase cygwinの環境でのバグ

5441 ワード

主な問題は、WindowsとLinuxのclasspathの区切り文字が異なることです.
 
問題の原因:
一日やって、簡単な地元のデフォルトのhbaseの環境が合わなくて、憂鬱です!
最後に、もとはhbaseスクリプトのバグ!!
 
Winseliu@WINSE ~/hbase-0.94.2
$ bin/hbase classpath
C:\cygwin\home\Winseliu\hbase-0.94.2\conf;C:\Java\jdk1.7.0_02\lib\tools.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\;C:\cygwin\home\Winseliu\hbase-0.94.2\hbase-0.94.2.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\hbase-0.94.2-tests.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\activation-1.1.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\asm-3.1.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\avro-1.5.3.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\avro-ipc-1.5.3.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\commons-beanutils-1.7.0.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\commons-beanutils-core-1.8.0.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\commons-cli-1.2.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\commons-codec-1.4.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\commons-collections-3.2.1.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\commons-configuration-1.6.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\commons-digester-1.8.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\commons-el-1.0.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\commons-httpclient-3.1.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\commons-io-2.1.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\commons-lang-2.5.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\commons-logging-1.1.1.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\commons-math-2.1.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\commons-net-1.4.1.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\core-3.1.1.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\guava-11.0.2.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\hadoop-core-1.0.3.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\high-scale-lib-1.1.1.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\httpclient-4.1.2.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\httpcore-4.1.3.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\jackson-core-asl-1.8.8.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\jackson-jaxrs-1.8.8.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\jackson-mapper-asl-1.8.8.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\jackson-xc-1.8.8.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\jamon-runtime-2.3.1.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\jasper-compiler-5.5.23.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\jasper-runtime-5.5.23.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\jaxb-api-2.1.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\jaxb-impl-2.2.3-1.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\jersey-core-1.8.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\jersey-json-1.8.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\jersey-server-1.8.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\jettison-1.1.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\jetty-6.1.26.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\jetty-util-6.1.26.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\jruby-complete-1.6.5.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\jsp-2.1-6.1.14.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\jsp-api-2.1-6.1.14.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\jsr305-1.3.9.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\junit-4.10-HBASE-1.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\libthrift-0.8.0.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\log4j-1.2.16.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\metrics-core-2.1.2.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib
etty-3.2.4.Final.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\protobuf-java-2.4.0a.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\servlet-api-2.5-6.1.14.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\slf4j-api-1.4.3.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\slf4j-log4j12-1.4.3.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\snappy-java-1.0.3.2.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\stax-api-1.0.1.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\velocity-1.7.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\xmlenc-0.52.jar;C:\cygwin\home\Winseliu\hbase-0.94.2\lib\zookeeper-3.4.3.jar:

 
環境変数は最後に「;」であるべきである.そして今は「:」
 
問題解決
修正は以下の通りです(実はcygwin変換のコード位置を移動しました):
Winseliu@WINSE ~/hbase-0.94.2/bin
$ diff -urN hbase-old hbase
--- hbase-old   2012-10-08 04:04:16.000000000 +0800
+++ hbase       2012-11-25 19:08:06.408506700 +0800
@@ -199,13 +199,6 @@
   HBASE_LOGFILE='hbase.log'
 fi
 
-# cygwin path translation
-if $cygwin; then
-  CLASSPATH=`cygpath -p -w "$CLASSPATH"`
-  HBASE_HOME=`cygpath -d "$HBASE_HOME"`
-  HBASE_LOG_DIR=`cygpath -d "$HBASE_LOG_DIR"`
-fi
-
 function append_path() {
   if [ -z "$1" ]; then
     echo $2
@@ -227,6 +220,13 @@
   CLASSPATH=$(append_path "${CLASSPATH}" `${HADOOP_IN_PATH} classpath 2>/dev/null`)
 fi
 
+# cygwin path translation
+if $cygwin; then
+  CLASSPATH=`cygpath -p -w "$CLASSPATH"`
+  HBASE_HOME=`cygpath -d "$HBASE_HOME"`
+  HBASE_LOG_DIR=`cygpath -d "$HBASE_LOG_DIR"`
+fi
+
 if [ -d "${HBASE_HOME}/build/native" -o -d "${HBASE_HOME}/lib/native" ]; then
   if [ -z $JAVA_PLATFORM ]; then
     JAVA_PLATFORM=`CLASSPATH=${CLASSPATH} ${JAVA} org.apache.hadoop.util.PlatformName | sed -e "s/ /_/g"`