sqoop主要是在关系型数据库与hadoop交互数据。作为hadoop的客户端工具。可安装在任一节点上,我安装在master上的。
1.tar -zxvf /opt/sqoop-1.4.6-cdh5.8.0.tar.gz
2.修改环境变量
vi /etc/profile
加入:
export SQOOP_HOME=/opt/sqoop-1.4.6-cdh5.8.0
export PATH=$PATH:$SQOOP_HOME/bin
执行命令:
source /etc/profile
3.验证成功否
[hadoop@master ~]$ sqoop list-databases --connect jdbc:mysql://master:3306/ --username root -password 123456
Warning: /opt/sqoop-1.4.6-cdh5.8.0/../hcatalog does not exist! HCatalog jobs will fail.
Please set $HCAT_HOME to the root of your HCatalog installation.
Warning: /opt/sqoop-1.4.6-cdh5.8.0/../accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
Warning: /opt/sqoop-1.4.6-cdh5.8.0/../zookeeper does not exist! Accumulo imports will fail.
Please set $ZOOKEEPER_HOME to the root of your Zookeeper installation.
17/03/23 15:44:43 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6-cdh5.8.0
17/03/23 15:44:43 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
17/03/23 15:44:43 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
information_schema
hive
hue
mysql
test
[hadoop@master ~]$