Sqoop Import error - on Cloudera Quickstart VM


#1

Unable to do a simple import command for sqoop on Cloudera Quickstart VM:

org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.AccessControlException): Permission denied: user=cloudera, access=WRITE, inode="/user":hdfs:supergroup:drwxr-xr-x

Steps to overcome this error:

sudo -u hdfs hadoop fs -mkdir /user/cloudera
sudo -u hdfs hadoop fs -chown cloudera /user/cloudera
hadoop fs -mkdir -p /user/cloudera/sqoop_import/retail_db

sqoop import \
  --connect jdbc:mysql://quickstart.cloudera:3306/retail_db \
  --username root \
  --password cloudera \
  --table order_items \
  --target-dir /user/cloudera/sqoop_import/retail_db/order_items