sqoop将表导入到配置单元中,配置单元的thrift服务器是否运行

wpcxdonn  于 2021-06-03  发布在  Hadoop
关注(0)|答案(0)|浏览(258)

使用sqoop将表导入配置单元时遇到问题。
在java代码中,我使用ssh连接到配置单元的服务器,并执行sqoop import命令,该命令将一个表从postgresql导入配置单元。
在my hive-site.xml中,我指定了:

<property>
  <name>hive.metastore.warehouse.dir</name>
  <value>/hlservices/hive/warehouse</value>
  <description>location of default database for the warehouse</description>
</property>

如果:配置单元的thrift服务器未运行:
导入的表将 /hlservices/hive/warehouse/mytable 如hive-site.xml所述。我还可以使用“show tables”或“descripe mytable”在hive的shell中查看导入的表
如果:Hive的旧服务器正在运行:
导入的表将 /user/hlservices/mytable (也是dfs中的一个路径),我在Hive的外壳中看不到它。
不管thrift服务器是否运行,都会导致不同的结果!
由于不熟悉,我很难找到要更改配置的文件。
在我的项目中,thrift服务器需要启动并且永不停止。如何告诉sqoop或hive在hive的thrift运行时选择正确的导入路径?
所有hive-site.xml文件

./sqoop-1.4.4.bin__hadoop-1.0.0/testdata/hcatalog/conf/hive-site.xml
./hive-0.10.0/src/data/conf/hive-site.xml
./hive-0.10.0/src/common/src/test/resources/hive-site.xml
./hive-0.10.0/src/pdk/scripts/conf/hive-site.xml
./hive-0.10.0/src/conf/hive-site.xml
./hive-0.10.0/scripts/pdk/conf/hive-site.xml
./hive-0.10.0/conf/hive-site.xml

其中,sqoop文件夹中的第一个hive-site.xml有:

<property>
    <name>hive.metastore.warehouse.dir</name>
    <value>${test.build.data}/sqoop/warehouse</value>
  </property>

我试图修改它,并使其与hive的conf文件夹下的hive-site.xml相同,但没有成功

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题