Tuesday, March 20, 2018

Sqoop


Sqoop

·          Install and configure Sqoop on cluster
·          Connecting to RDBMS
·          Installing Mysql
·          Import data from Mysql to hive
·          Export data to Mysql
·          Internal mechanism of import/export











Importing  data  from  to  HDFS from RDBMS



From HDFS edge node or from client -  to see list of all available databases




Some  familiar commands


  • sqoop list-databases  --connect "jdbc:mysql://quickstart.cloudera:3306/retail_db"  --username=retail_dba  --password=cloudera    --warehouse-dir=/user/cloudera/sqoop_import



mysql -u retail_dba -p


sqoop list-databases  --connect "jdbc:mysql://quickstart.cloudera:3306/retail_db"  --username=retail_dba  --password=clouderamysql -u retail_dba -p

CREATE TABLE employees_export (
emp_no int(11) NOT NULL,
birth_date date NOT NULL,
first_name varchar(14) NOT NULL,
last_name varchar(16) NOT NULL,
gender enum('M','F') NOT NULL,
hire_date date NOT NULL,
PRIMARY KEY (emp_no)



sqoop import  --connect "jdbc:mysql://quickstart.cloudera:3306/retail_db"  --username=retail_dba  --password=cloudera --table employees_export1  --warehouse-dir=/user/cloudera/sqoop_import -m 1











1 comment:

  1. Devops Training in Hyderabad. DevOps is a set of practices that combines software development and IT operations. It aims to shorten the systems development life cycle and provide continuous delivery with high software quality.
    DevOps Training in Hyderabad

    DevOps Course in Hyderabad

    ReplyDelete

Hyderabad Trip - Best Places to visit

 Best Places to Visit  in Hyderabad 1.        1. Golconda Fort Maps Link :   https://www.google.com/maps/dir/Aparna+Serene+Park,+Masj...