当前位置: 首页> 房产> 政策 > 深圳网站建设公司排行榜_北京房产网二手房出售_百度网盘会员_网站搜索排名优化怎么做

深圳网站建设公司排行榜_北京房产网二手房出售_百度网盘会员_网站搜索排名优化怎么做

时间:2025/7/12 6:59:22来源:https://blog.csdn.net/qq_44540985/article/details/143388792 浏览次数:0次
深圳网站建设公司排行榜_北京房产网二手房出售_百度网盘会员_网站搜索排名优化怎么做

        此篇博客仅记录在使用sqoop时遇到的各种问题。持续更新,有问题评论区一起探讨,写得有不足之处见谅。

Oracle_to_hive

1. main ERROR Could not register mbeans java.security.AccessControlException: access denied ("javax.management.MBeanTrustPermission" "register")

日期:20241031

原因分析:Sqoop 在执行导入时依赖了 Hive,Hive 启用了 Log4j 的 JMX 功能,在没有足够权限的情况下尝试注册 MBeans 时被阻止,从而引发该错误

解决方法:

修改jdk的文件找到:jdk安装目录/jre/lib/security/java.policy

具体配置如下:在文件中添加如下内容
        permission javax.management.MBeanTrustPermission "register";

2. org.apache.atlas.AtlasException: Failed to load application yaml当集群配置了atlas时,可能会遇到此问题

日期:20241031

原因分析:无法在classpath提及的目录中找到application-atlas.yml文件

将找到的配置文件,拷贝到classpath起止一个地址中:

3. cannot recognize input near ',' 'gcrq_month' ',' in column type
24/10/31 17:05:16 ERROR ql.Driver: FAILED: ParseException line 1:895 cannot recognize input near ',' 'gcrq_month' ',' in column type
org.apache.hadoop.hive.ql.parse.ParseException: line 1:895 cannot recognize input near ',' 'gcrq_month' ',' in column type。sqoop只支持单分区问题

日期:20241031

原因分析:导入数据到hive表时,使用了多个分区字段

源码级别解析可以看:Sqoop 数据导入多分区Hive解决方法_sqoop import 多个分区-CSDN博客

换种简单的解决方式,通过HCatalog解决,先查看是否安装HCatalog

然后参数使用HCatalog:

--split-by MINUTE \
--hive-import \
--hive-table ods_pre_dat_dcsj_time \
--target-dir /user/sqoop/hive/oracle_to_hive/ods_pre_dat_dcsj_time \
--delete-target-dir \
-- --hive-drop-import-delims \
--hcatalog-database dw \
--hcatalog-table ods_pre_dat_dcsj_time \
--hcatalog-storage-stanza 'stored as orc' \
--hcatalog-partition-keys "gcrq_year,gcrq_month,gcrq_day" \
--hcatalog-partition-values "${gcrq_year},${gcrq_month},${gcrq_day}" \

--num-mappers 3 

4. FAILED: HiveAuthzPluginException Error getting permissions for hdfs://udh/user/sqoop/hive/oracle_to_hive/ods_pre_dat_dcsj_time : Unauthorized connection for super-user: hive from IP /xxx.xxx.xxx.xxx

日期:20241101

原因分析:猜测权限问题,其中xxx.xxx.xxx.xxx为我提交sqoop命令所在的服务器,“hive ”为我在服务器上以hive用户身份提交sqoop。我在sqoop命令中指定存放数据的临时目录为:--target-dir /user/sqoop/hive/oracle_to_hive/ods_pre_dat_dcsj_time,查看一下此目录的权限

发现存放临时数据目录下是有数据文件的,再看看它的父目录:

尝试用hdfs dfs -chown修改其父目录权限,改为拥有者为hive。再次执行,还是报错。

        转换下思路,难道是hive的权限限制问题?Unauthorized connection for super-user: hive from IP /10.81.35.162,大白话翻译:超级用户的未经授权的连接。而在 Hive 中,hive 用户通常是一个默认的超级用户,具备访问和操作 Hive 的所有权限

        在hdfs的core-site文件中配置:

<property>
    <name>hadoop.proxyuser.hive.groups</name>
    <value>*</value> <!-- 允许所有用户组访问 -->
</property>
<property>
    <name>hadoop.proxyuser.hive.hosts</name>
    <value>xxx.xxx.xxx.xxx</value> <!-- 允许特定 IP 地址访问 ,多ip逗号分隔-->
</property>

ambari修改的话一般在HDFS的自定义core-site中,改为以上配置后需要先重启HDFS再重启HIve

关键字:深圳网站建设公司排行榜_北京房产网二手房出售_百度网盘会员_网站搜索排名优化怎么做

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: