I've been able to use Sqoop & Flume import commands perfectly fine on Ubuntu terminal. But right now, I'm trying to do so on Jupyter notebook.
1) How can I import from MySQL to HDFS using Sqoop command on Jupyter notebook?
2) what is Flume import python code?
What I have tried:
In terminal:
FLUME
Flume-ng agent -n TwitterAgent --conf-file /home/amel/flumeconf --conf /home/amel/flumeconf
SQOOP
Sqoop list-databases --connect jdbc:mysql://localhost:3306/testDb --username Amel --password Amel@-1998;
JUPYTER
import subprocess
import logging
from pysqoop.SqoopImport import Sqoop
sqoop = Sqoop(fs='hdfs://localhost:50070',
table='mock3', target_dir='hdfs://user/amel',connect='jdbc:mysql://localhost:3306/testDb',
username='Amel', password='Amel@-1998', num_mappers=2,
bindir='/usr/local/hadoop/sqoop/bin')
sqoop.perform_import()
this is the error i get
sqoop import None -fs hdfs://localhost:50070 --table mock3 --target-dir hdfs://user/amel --connect jdbc:mysql://localhost:3306/testDb --username Amel --password Amel@-1998 --num-mappers 2 --bindir /usr/local/hadoop/sqoop/bin --help
name 'run' is not defined
90