Created on 01-19-2017 06:00 AM - edited 09-16-2022 03:55 AM
I created a Cloudera cluster for Impala.
If I run the following command via impala-shell:
create table test as select 1;
The following error is returned:
WARNINGS: Failed to open HDFS file for writing: hdfs://[DNhostname]:8020/user/hive/warehouse/test/_impala_insert_staging/[...]/[...].0. Error(255): Unknown error 255
However, if I run:
create table test (testcol int); insert into test select 1;
...The table is created and data is inserted without a hitch.
Any ideas on why the first statement might fail while the second set of commands would succeed, and what I could do to fix it? I might have messed something up with directory permissions, either locally or on HDFS, however I've set 'dfs.permissions' to false to turn off HDFS permissions. I don't know what to check on the local folders to ensure the correct user(s) have the right permissions. In either case, I don't know why the permissions would cause the 'CREATE TABLE AS SELECT' statement to fail but not the 'CREATE... INSERT'.
I should also mention that 'DNhostname' is the hostname of the HDFS datanode/impala daemon that I'm SSHed into, not the hostname of the namenode. This worries me because 'DNhostname' was originally where my namenode was located; I moved it to a different host for reasons outside the scope of this question. Is it possible that 'CREATE TABLE AS SELECT' is still expecting the namenode to be 'DNhostname' for some reason?
Created 01-19-2017 09:05 AM
Was the below action performed after moving the namenode?
The HiveMetastoreDatabase maintains the location of tables and databases. So once after moving the namenode, it is necessary to perform the above step to update the locations in HMS.
Created 01-19-2017 08:57 AM
1. Can you check the value of "fs.defaultFS" in core-site.xml file in impalad process directory
a. impalad process directory --
/var/run/cloudera-scm-agent/process/<num>-impala-IMPALAD
Replace <num> with the latest number under process directory
Then you can run
grep -Rn 8020 * -b1
Please let me know if the hostname in the value tag matches the current namenode
Created 01-19-2017 09:02 AM
Created 01-19-2017 09:05 AM
Was the below action performed after moving the namenode?
The HiveMetastoreDatabase maintains the location of tables and databases. So once after moving the namenode, it is necessary to perform the above step to update the locations in HMS.
Created 01-19-2017 09:14 AM
Created 01-19-2017 09:19 AM
You're welcome!