A Import from MySQL to HBase (hands on excercise explanation)
-----Make sure your HBase is running
Go to $HBASE_HOME/bin
execute the following commands
$HBASE_HOME/bin >start-hbase.sh
$HBASE_HOME/bin >hbase shell
hbase> list_namespace_tables 'default'
to see the list of tables;
___________
Go to $SQOOP_HOME/bin>./sqoop import --connect jdbc:mysql://192.x.x.x/sakila --table actor --username <...> --password<...>
--hbase-table actor --column-family pd
--hbase-row-key actor_id --hbase-create-table - m 1
_________________
This above command will create a table in hbase default database and loads the data from MySQL table "actor"
No comments:
Post a Comment