Friday 21 June 2013

Impala error connecting running impala-shell on port 21000

Installed impala using Cloudera Manager.

Then logged on to one of the servers in the cluster (called below) and tried connecting to impala.
It failed with this error (see the details below):
"Error connecting: , Could not connect to localhost:21000"

I made a basic error.
There was no impalad daemon on this server (called below).
There was only an Impala Statestore daemon running on it.
So I needed to determine one of the servers running impalad and direct impala-shell to it using the -i command line option to determine the interface.
And it worked - see the access working in the last step.
Note I needed to refresh to be able to see my new mytable table.
Last word on impala - am impressed with the speed returned from a simple impala count(*) on mytable versus hive equivalent.

Not working

$ ps -ef | grep impala | grep -v grep 
impala   30929 19867  0 13:13 ?        00:00:19 /opt/cloudera/parcels/IMPALA-1.0.1-1.p0.431/lib/impala/sbin-retail/statestored --flagfile=/var/run/cloudera-scm-agent/process/215-impala-STATESTORE/impala-conf/state_store_flags

$ impala-shell  -i localhost
Error connecting: , Could not connect to localhost:21000
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.0.1 (df844fb) built on Tue Jun  4 08:08:13 PDT 2013)
[Not connected] > exit;

$ impala-shell  -i
Error connecting: , Could not connect to :21000
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.0.1 (df844fb) built on Tue Jun  4 08:08:13 PDT 2013)
[Not connected] > exit

Working

$ impala-shell -i myimpalaserver
Connected to myimpalaserver:21000
Server version: impalad version 1.0.1 RELEASE (build df844fb967cec8740f08dfb8b21962bc053527ef)
Unable to load history: [Errno 2] No such file or directory
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.0.1 (df844fb) built on Tue Jun  4 08:08:13 PDT 2013)
[myimpalaserver:21000] > select * from mytable where load_dt = '20130410' and batch = '1' limit 4;
Query: select * from mytable where load_dt = '20130410' and batch = '1' limit 4
ERROR: AnalysisException: Unknown table: 'mytable'
[myimpalaserver:21000] > refresh ;
Successfully refreshed catalog
[myimpalaserver:21000] > show tables;      
Query: show tables
Query finished, fetching results ...
+-----------------+
name            |
+-----------------+
| mytable         |
+-----------------+
Returned 1 row(s) in 0.11s
[myimpalaserver:21000] > select * from mytable where load_dt = '20130410' and batch = '1' limit 4;
Query: select * from mytable where load_dt = '20130410' and batch = '1' limit 4

Query finished, fetching results ...

No comments: