Sqoop import tables access denied


#1

I am trying to use the following command to import a table from mysql database
sqoop import --connect “jdbc:mysql://nn01.itversity.com:3306/retail_db” --username retail_dba --password itversity --table order_items --target-dir “/home/siddartha/retail_db/order_items”

but get this error:
Caused by: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.AccessControlException): Permission denied: user=siddartha, access=WRITE, inode="/home/siddartha/retail_db/order_items/_temporary/1":hdfs:hdfs:drwxrwxr-x

Is that the correct folder to write to? If so, why don’t I have permission to write to it?


#2

@siddartha

/home/siddartha is your home directory in Linux.
/user/siddartha is your home directory in Hadoop.
and
order_items table already exits in your retail_db directory. so try to append(add) it.

Try below command it is working fine:

sqoop import --connect “jdbc:mysql://nn01.itversity.com:3306/retail_db” --username retail_dba --password itversity --table order_items --target-dir /user/siddartha/retail_db/order_items --append


#3