一 問題描述
采用package包方式安裝cdh時, 安裝程式會将impala-shell目錄下的所有檔案複制到/usr/lib/impala-shell下面, 但采用parcels安裝時,安裝程式并不會建立/usr/lib/impala-shell目錄,也不會複制相應的檔案, 是以安裝好cdh後,執行impala-shell會報impala_shell.py找不到.
[root@kthdpp01 hadoop]# impala-shell
ls: 無法通路/usr/lib/impala-shell/ext-py/*.egg: 沒有那個檔案或目錄
python: can't open file '/usr/lib/impala-shell/impala_shell.py': [errno 2] no such file or directory
二 解決方案
mkdir -p /usr/lib/impala-shell/
/opt/cloudera/parcels/cdh/lib/impala-shell
cp -r * /usr/lib/impala-shell/
運作impala-shell指令,可以正常的執行查詢
[root@kthdpp01 impala-shell]# impala-shell
starting impala shell without kerberos authentication
connected to kthdpp01.kt:21000
server version: impalad version 1.3.1-cdh5 release (build 2cd2029d7e7871fdaa3b214d547a378205146f4c)
welcome to the impala shell. press tab twice to see a list of available commands.
copyright (c) 2012 cloudera, inc. all rights reserved.
(shell build version: impala shell v1.3.1-cdh5 (2cd2029) built on mon may 5 20:45:59 pdt 2014)
[kthdpp01.kt:21000] > select * from tbtest3;
query: select * from tbtest3
+----+------+
| id | name |
| 1 | null |
| 2 | null |
| 3 | null |
| 4 | null |
| 5 | null |
returned 5 row(s) in 0.30s