Database Reference
In-Depth Information
I have obscured the password above, but the command gives MySQL on the local node the username and proper
password, as well as the hostname of the remote server. Once the mysql> prompt is available, I can try to get a row
count from the rawdata table:
mysql> select count(*) from sqoop.rawdata;
+-----------+
| count(*) |
+-----------+
| 20031 |
+-----------+
The results show that the rawdata table exists and is accessible by the sqoop database account, and that the table
contains 20,031 rows of data for the import test. The data is just textual data contained in a table with a single column
called “rawline,” which contains the textual row data. I'm good to go.
any relational database access problems must be fixed before you proceed, given that MySQL is being used in
this example. Further information can be found at the MySQL website at http://dev.mysql.com/doc/ .
Note
Install Sqoop
Given that the Cloudera stack was installed in Chapter 2, you can simply install Sqoop as the root user account on the
server hc1nn as follows, using yum :
[root@hc1nn ~]# yum install sqoop
To check that the Sqoop installation was successful, you use the version option:
[hadoop@hc1nn conf]$ sqoop version
Warning: /usr/lib/hcatalog does not exist! HCatalog jobs will fail.
Please set $HCAT_HOME to the root of your HCatalog installation.
Warning: /usr/lib/sqoop/../accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
14/07/17 18:41:17 INFO sqoop.Sqoop: Running Sqoop version: 1.4.3-cdh4.7.0
Sqoop 1.4.3-cdh4.7.0
git commit id 8e266e052e423af592871e2dfe09d54c03f6a0e8
Compiled by jenkins on Wed May 28 11:36:29 PDT 2014
Note that this check for my example yielded a couple of warnings: HCatalog and Accumulo (the database) are not
installed. But as they are not used in the example, these warnings can be ignored.
In order to use MySQL, however, you must download and install a connector library for MySQL, as follows:
[root@hc1nn ~]# wget http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.22.tar.gz
 
 
Search WWH ::




Custom Search