我運行下面的shell腳本,蜂巢腳本問題
#!/bin/bash
HADOOP_HOME='/home/hadoop/hadoop-0.20.2'
HIVE_HOME='/home/hadoop/hive-0.8.0'
echo -e '1\x01foo' > /tmp/a.txt
echo -e '2\x01bar' >> /tmp/a.txt
HADOOP_CORE={{ls $HADOOP_HOME/hadoop-0.20.2-core.jar}}
CLASSPATH=.:$HADOOP_CORE:$HIVE_HOME/conf
for i in ${HIVE_HOME}/lib/*.jar ; do
CLASSPATH=$CLASSPATH:$i
done
java -cp $CLASSPATH HiveJdbcClient
在這段代碼的每個變量設置正確。我已按照here的說明編寫代碼。我的配置單元版本是0.8.0。 當我運行我的代碼,它給了我下面的錯誤,
./test.sh
./test.sh: line 8: /home/hadoop/hadoop-0.20.2/hadoop-0.20.2-core.jar}}: No such file or directory
Exception in thread "main" java.sql.SQLException: Could not establish connection to localhost:10000/default: java.net.ConnectException: Connection refused
at org.apache.hadoop.hive.jdbc.HiveConnection.<init>(HiveConnection.java:98)
at org.apache.hadoop.hive.jdbc.HiveDriver.connect(HiveDriver.java:104)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at HiveJdbcClient.main(HiveJdbcClient.java:22)
誰能請解釋我這個錯誤是什麼意思?