Database Reference
In-Depth Information
5.
Finally, we can copy twitterdata from the csv file using the
copy command over the cql shell:
copy twitterdata from '/tmp/mysql_output.csv';
This way, we can perform data migration in the traditional way. Unfortunately it
happens in the localized way.
It looks simple, but what about migrating the complete schema containing multiple
tables? Would giving the name of the schema would be more than sufficient to estab-
lish tunnel and migrate data? Apache Sqoop (SQL to Hadoop) is an answer for these
questions.
Apache Sqoop
Apache Sqoop is a tool to transfer data from relational databases to NoSQL databases
such as Cassandra or distributed file systems such as Hadoop. Sqoop has been an
Apache TLP since 2012. Sqoop comes in very handy when we need to establish a tun-
nel for data migration between RDBMS and NoSQL (e.g., Cassandra, Hadoop).
We will be using DataStax's DSE for sample Sqoop Cassandra integration in this
section. For more details about DSE setup and configuration you can refer to
http://www.datastax.com/docs/datastax_enterprise3.1/
reference/start_stop_dse
http://www.datastax.com/docs/datastax_enterprise3.0/
install/install_rpm_pkg
You can also download and extract the tarball in a local folder.
Sqoop with Cassandra
For a Sample Exercise We Will Use the Same Tweets File We Used Previously and
Then Finally use DSE Sqoop Support to Migrate From MySQL to Cassandra.
1.
First, let's connect to the MySQL client:
mysql -u root -p -local-infile
Search WWH ::




Custom Search