[hadoop@master hadoop]$ hive
/exapp/hive/hive-0.8.1/bin/hive: line 179: conditional binary operator expected
/exapp/hive/hive-0.8.1/bin/hive: line 179: syntax error near `=~'
/exapp/hive/hive-0.8.1/bin/hive: line 179: `if [[ "$HADOOP_VERSION" =~ $hadoop_version_re ]]; then'
自己查看代码
# between Bash 3.1 and 3.2
hadoop_version_re="^([[:digit:]]+)\.([[:digit:]]+)(\.([[:digit:]]+))?.*$"
if [[ "$HADOOP_VERSION" =~ $hadoop_version_re ]]; then.......
上面说的bash 版本 必须在3.1和3.2之间
查看下自己bash 版本
[hadoop@master hadoop]$ bash --version
GNU bash, version 2.05b.0(1)-release (i386-redhat-linux-gnu)
Copyright (C) 2002 Free Software Foundation, Inc.
貌似才2.05, 遂升级。
地址:http://ftp.gnu.org/gnu/bash/bash-3.1.tar.gz
下载后上传至服务器
[hadoop@master hadoop]$ ls
bash-3.1.tar.gz hive-0.8.1.tar.gz .....
权限不够切换用户:
[hadoop@master hadoop]$ su - root
[hadoop@master root]# mv bash-3.1.tar.gz /usr/local/src
[hadoop@master root]# cd /usr/local/src
[hadoop@master root]# tar zxvf bash-3.1.tar.gz
[hadoop@master root]# cd bash-3.1
[hadoop@master root]# ./configure
[hadoop@master root]# make
[hadoop@master root]# make install
重新登录用户,查看:
[hadoop@master hadoop]$ bash -version
GNU bash, version 3.1.0(1)-release (i686-pc-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.
[hadoop@master hadoop]$ hive
Logging initialized using configuration in file:/exapp/hive/hive-0.8.1/conf/hive-log4j.properties
Hive history file=/tmp/hadoop/hive_job_log_hadoop_201302050055_247239527.txt
hive>
进来了,搞定!