自1.99.7开始,客户端的一些操作关键字和参数发生了变化,网上很多还是早期版本,对照操作时难免一些命令或选项会报错。这里把本地实际操作过程及注意事项记录如下,作后续参考。
蓝色表示输入的内容, //后后面的为备注和解释,红色表示注意的地方。
1. bin/sqoop.sh client 启动客户端
hadoop@master:~/bigdata/sqoop$ bin/sqoop.sh client
Setting conf dir: bin/../conf
Sqoop home directory: /home/hadoop/bigdata/sqoop
Sqoop Shell: Type 'help' or '\h' for help.
sqoop:000>
sqoop:000> show version
client version:
Sqoop 1.99.7 source revision 435d5e61b922a32d7bce567fe5fb1a9c0d9b1bbb
Compiled by abefine on Tue Jul 19 16:08:27 PDT 2016
sqoop:000>
sqoop:000> set server --host master --port 12000 --webapp sqoop // host 即hadoop NameNode host
Server is set successfully
sqoop:000> show connector
0 [main] WARN org.apache.hadoop.util.NativeCodeLoader - Unable to load native-hadoop library for your platform... using builtin-java classes where applicable // hadoop checknative -a 能显示多数库都是true即可,目前好像不受影响。可能是so不存在,so的格式不对如32bit, 64bit 等, refer to http://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/NativeLibraries.html
+------------------------+---------+------------------------------------------------------------+----------------------+
| Name | Version | Class | Supported Directions |
+------------------------+---------+------------------------------------------------------------+----------------------+
| generic-jdbc-connector | 1.99.7 | org.apache.sqoop.connector.jdbc.GenericJdbcConnector | FROM/TO |
| kite-connector | 1.99.7 | org.apache.sqoop.connector.kite.KiteConnector | FROM/TO |
| oracle-jdbc-connector | 1.99.7 | org.apache.sqoop.connector.jdbc.oracle.OracleJdbcConnector | FROM/TO |
| ftp-connector | 1.99.7 | org.apache.sqoop.connector.ftp.FtpConnector | TO |
| hdfs-connector | 1.99.7 | org.apache.sqoop.connector.hdfs.HdfsConnector | FROM/TO |
| kafka-connector | 1.99.7 | org.apache.sqoop.connec