首页 > 解决方案 > 在 HDFS 中看不到数据,使用 sqoop 从 mariadb 导入表到 Hadoop

问题描述

我的输出低于

    [dsawale@localhost lib]$ sqoop import --connect jdbc:mysql://localhost/sqoop -username root -password maria \
> --table purchases --target-dir /sqoop/purchases
Warning: /home/dsawale/sqoop-1.4.7.bin__hadoop-2.6.0/../hbase does not exist! HBase imports will fail.
Please set $HBASE_HOME to the root of your HBase installation.
Warning: /home/dsawale/sqoop-1.4.7.bin__hadoop-2.6.0/../hcatalog does not exist! HCatalog jobs will fail.
Please set $HCAT_HOME to the root of your HCatalog installation.
Warning: /home/dsawale/sqoop-1.4.7.bin__hadoop-2.6.0/../accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
Warning: /home/dsawale/sqoop-1.4.7.bin__hadoop-2.6.0/../zookeeper does not exist! Accumulo imports will fail.
Please set $ZOOKEEPER_HOME to the root of your Zookeeper installation.
[dsawale@localhost lib]$

我无法弄清楚为什么数据没有显示在 Hadoop 中。

[dsawale@localhost ~]$ hadoop fs -ls /
Found 5 items
drwxr-xr-x   - dsawale supergroup          0 2020-03-24 13:02 /pysampleout
drwxr-xr-x   - dsawale supergroup          0 2020-03-22 15:30 /sam
-rwxrwxrwx   1 dsawale supergroup         86 2020-03-22 12:56 /sample.txt
drwxrwx---   - dsawale supergroup          0 2020-03-07 00:20 /tmp
drwxr-xr-x   - dsawale supergroup          0 2020-03-23 10:32 /user

你能帮我吗,我是hadoop的初学者吗?

我可以看到列表表命令对我有用

[dsawale@localhost ~]$ sqoop list-tables --connect jdbc:mysql://localhost/sqoop -username root -password maria 
Warning: /home/dsawale/sqoop-1.4.7.bin__hadoop-2.6.0/../hbase does not exist! HBase imports will fail.
Please set $HBASE_HOME to the root of your HBase installation.
Warning: /home/dsawale/sqoop-1.4.7.bin__hadoop-2.6.0/../hcatalog does not exist! HCatalog jobs will fail.
Please set $HCAT_HOME to the root of your HCatalog installation.
Warning: /home/dsawale/sqoop-1.4.7.bin__hadoop-2.6.0/../accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
Warning: /home/dsawale/sqoop-1.4.7.bin__hadoop-2.6.0/../zookeeper does not exist! Accumulo imports will fail.
Please set $ZOOKEEPER_HOME to the root of your Zookeeper installation.
purchases

标签: hadoophdfssqoop

解决方案


推荐阅读