大数据问题及解决方法

前言

创建时间:2023-06-7
最后更新时间:2023-06-7

一、ICONTROL 代理安装文档(linux)

  • 代理端部署

1、需要的安装包:icontrol_proxy.zip

2、解压安装包:icontrol_proxy.zip

命令:unzip ./ icontrol_proxy.zip -d icontrol_proxy

3、查看解压后的icontrol_proxy文件夹中的内容

   必须要有 init.sh
           startup-tomcat.sh
		   startup-zookeeper.sh
		   app(在APP中必须要有common、linux)
		   web
  • 注意点
(1)保证telnet可以访问服务端命令:例:telnet 172.16.84.117 2181
(2)保证服务端的防火墙和代理端的防火墙都是关闭的
(3)如果telnet不能使用,则需要安装telnet
(4)保证这个文件下的连接是服务端的zookeeper地址
    地址:/software/iControl-proxy/web/imatrix-proxy-web/WEB-INF/classes/cfg-jdbc.properties
    例如:zookeeper.connect_string=172.16.84.117\:2181

4、对init文件赋予可执行权限

命令: chmod +x init.sh

5、执行init.sh文件

命令:./init.sh

6、启动tomcat

命令:./startup-tomcat.sh

7、启动tomcat

命令:./startup-zookeeper.sh

8、登录icontrol的界面

系统管理-->代理节点-->添加代理 即可

二、问题列表

问题1:

遇到icontrol调任务时,不能写入的问题
  • 解决方法:
--切换hdfs用户
su -hdfs
--授权写入目录
hadoop fs -chown -R impala:hive /user/hive/warehouse/etl_aml.db/tinf_customerinfo/c_tano=02/*
--授权写入权限
hdfs dfs -chmod -R 777 /user/hive/warehouse/etl_aml.db/tinf_customerinfo/*
--刷新impala,在172.16.80.24:8888/hue上左侧选择刷新,点击Invalidate all metadata and rebuild index,点击刷新

问题2:

在icontrol调任务时,出现DatabaseError:Error while trying to retrieve text for error ORA-01804的问题
  • 解决方法:
   检查oracle所在的机器上的环境变量
	cat /etc/profile
	需要有以下的环境变量配置:
	export ORACLE_BASE=/home/oracle/oracle_base
    export ORACLE_HOME=/home/oracle/oracle_base/product/11.2.0/db
    export PATH=$PATH:${JAVA_HOME}/bin:/usr/bin:${ORACLE_HOME}/bin
	在主节点上该路径下/opt/cloudera/parcels/CDH/lib/sqoop放入驱动包ojdbc6.jar
	重新启动linux和windows的tomcat和zookeeper


问题3:

Permission denied by sticky bit: user=root, path="/user/hive/warehouse/ods.db/ip_natural_person_ext":hive:hive:drwxrwxrwt, parent="/user/hive/warehouse/ods.db":hive:hive:drwxrwxrwt
  • 解决方法:
--查看hdfs用户下ods库的表:
hdfs dfs -ls /user/hive/warehouse/ods.db
--授权写入目录:
hadoop fs -chown -R root:hive /user/hive/warehouse/ods.db/ip_natural_person_ext
--授权写入权限
hdfs dfs -chmod -R 777 /user/hive/warehouse/ods.db/ip_natural_person_ext
--刷新impala,在172.16.80.26:8888/hue上左侧选择刷新,点击Invalidate all metadata and rebuild index,点击刷新

问题4:

本地文件导入hive数据库操作
  • 解决方法:
--建立临时表,以逗号(,)分割符分割:
 CREATE TABLE test.comm_mkt_tradetype(
       a  string,
	   b  string,
	   c  string
	   )
    ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' ;
--将xxxxxx本地文件上传到该目录/software/bigdata/python/tmp
  (注意:文件目录可以自定义)
--将上传的数据文件导入临时表中,在hive页面执行以下语句:
load data local inpath '/software/bigdata/python/tmp/xxxxxx' into table test.comm_mkt_tradetype;
--将临时表中的数据插入目标表(注意:hive可以跨库操作)
insert overwrite table ods.comm_mkt_tradetype 
 select * from test.comm_mkt_tradetype ;

问题5:

批量修改后台任务
  • 解决方法:
update  sch_task t set t.name=replace(t.name,'lofta20200908135044966','etfta') where  
 t.name like '%20200908135044966'
update  sch_task_job_shell t set t.param=replace(t.param,'-k -f /etl/hqlexec/sql','-f /software/bigdata/python/etl/hqlexec/sql') where 
 t.param like '-k -f /etl/hqlexec/sql

问题6:

oracle中base64加密、解密
  • 解决方法:
--解密:
select  utl_raw.cast_to_varchar2(utl_encode.base64_decode(utl_raw.cast_to_raw(t.db_passwd)))from dual t
--加密:
select  utl_raw.cast_to_varchar2(utl_encode.base64_encode(utl_raw.cast_to_raw(t.db_passwd)))from dual t

问题7:

新增数据源走kettle下载主数据遇到过程报分区错误(直销)
- 解决方法:(新加8个子分区)
alter table ***
add  partition PL_DS values ('DS')
    tablespace USERS
    pctfree 10
    initrans 1
    maxtrans 255
  (
    subpartition P_DS_PART_1 values (1) tablespace USERS,
    subpartition P_DS_PART_2 values (2) tablespace USERS,
    subpartition P_DS_PART_3 values (3) tablespace USERS,
    subpartition P_DS_PART_4 values (4) tablespace USERS,
    subpartition P_DS_PART_5 values (5) tablespace USERS,
    subpartition P_DS_PART_6 values (6) tablespace USERS,
    subpartition P_DS_PART_7 values (7) tablespace USERS,
    subpartition P_DS_PART_8 values (8) tablespace USERS
  );

问题8:

spark_split_agency_etfta报错问题
  • 解决方法:
1、在账户里面加入IP_AGENCY的程序,跑数
          2、查看该sql语句的数据是否为0,若为0 则正常;否则将查出来的值插入ODS.ip_agency_mapp表中
		    SELECT distinct 
                        concat_ws('',agencyno_split,'...') as bk_agency
                   FROM ods.mid_trd_ta_saletran t
                  WHERE t.dk_system_of_sdata = 'ETFTA'
                    AND t.batchno = 53
                    and concat_ws('',agencyno_split,'...') not in(
                    select a.bk_agency
                   from ods.ip_agency_mapp a)  ;
				   
		     插入语句:
			     insert into ODS.ip_agency_mapp (
                                            bk_agency
                                           ,sk_agency
                                           ,top_agencyno
                                           ,agency_province_code
                                           ,agency_area_code
                                           ,agency_netno
                                           ,agency_netid
                                           ,dk_virtual_flag
                                           ,dk_append_from
                                           ,effective_from
                                           ,effective_to
                                           ,memo
                                           ,dk_is_valid
                                           ,dk_system_of_sdata
                                           ,sdata_serialno
                                           ,ddvc
                                           ,dk_system_of_upd
                                           ,batchno
                                           ,inserttime
                                           ,updatetime
                                           )
                                           values (
                                           'ETF...'                           
                                           ,3189170                            
                                           ,'786'                              
                                           ,null                               
                                           ,null                               
                                           ,null                               
                                           ,null                               
                                           ,'N'                                
                                           ,'0'                                
                                           ,cast('19000101' as decimal(8,0))                           
                                           ,cast('99991231' as decimal(8,0))                           
                                           ,NULL                               
                                           ,NULL                               
                                           ,'ETFTA'                            
                                           ,NULL                               
                                           ,NULL                               
                                           ,'ETFTA'                            
                                           ,cast('53' as decimal(16,0))                                 
                                           ,'2020-11-16 15:51:10.870685000'    
                                           ,'2020-11-16 15:51:10.870685000' );

问题8:

oracle中delete 删除数据恢复
  • 解决方案:
--delete 删除数据恢复

-- 1 使用dba权限查看当前scn值
SELECT CURRENT_SCN FROM V$DATABASE;

--2 找到上一个scn
SELECT checkpoint_change# FROM V$DATABASE;

--3 查看上一下的scn值中是否存有删除的数据
select * from test001 as of scn 上一个scn值;

--4 若上一个scn值存在删除的数据 则恢复数据
flashback table test001 to scn 上一个scn值; 

问题9:

大数据通过后台导文件加载数据
  • 解决方案:
--1 导出数据文件到本地
    1、将需要的数据存入/home/fxy/shenchan.txt文件中
    hive -e "select * from 表名 where 条件;" >重定向文件路径(文件格式自定义,分隔符默认)
	例:hive -e "select * from ods.shenchan a where a.dk_system_of_sdata='ETFTA';" > /home/fxy/shenchan.txt
	2、若文件较大,压缩文件
	tar -zcvf /home/fxy/shenchan.tar.gz /home/fxy/shenchan.txt 

--2 导入本地文件到新环境
    1、建表(和导出环境的表结构一致),注意文件路径
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

脸ル粉嘟嘟

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值