学习大数据DAY56 业务理解和第一次接入
作业1
作业2
#!/bin/bash
act=$1
start()
{
echo "starting xxl-job"
ssh root@hadoop100 "cd /opt/xxljob; nohup java -jar
xxl-job-admin-2.3.0.jar > xxl-job.log 2>&1 &"
ssh root@hadoop100 "cd /opt/xxljob; nohup java -jar
xxl-job-executor-sample-springboot-2.3.0.jar >
xxl-job-executor.log 2>&1 &"
ssh root@hadoop101 "cd /opt/xxljob; nohup java -jar
xxl-job-executor-sample-springboot-2.3.0.jar >
xxl-job-executor.log 2>&1 &"
ssh root@hadoop102 "cd /opt/xxljob; nohup java -jar
xxl-job-executor-sample-springboot-2.3.0.jar >
xxl-job-executor.log 2>&1 &"
}
stop(){
echo "stopping xxl-job"
ssh root@hadoop100 "ps -aux | grep xxl-job-admin | grep-v grep | awk '{print \$2}' | xargs kill -9"
ssh
root@hadoop100
"ps
-aux
|
grep
xxl-job-executor-sample | grep -v grep | awk '{print \$2}' |
xargs kill -9"
ssh
root@hadoop101
"ps
-aux
|
grep
xxl-job-executor-sample | grep -v grep | awk '{print \$2}' |
xargs kill -9"
ssh
root@hadoop102
"ps
-aux
|
grep
xxl-job-executor-sample | grep -v grep | awk '{print \$2}' |
xargs kill -9"
}
status(){
echo "=============== hadoop102 ==============="
ssh
root@hadoop102
"ps
-aux
|
grep
xxl-job-executor-sample | grep -v grep"
echo "=============== hadoop101 ==============="
ssh
root@hadoop101
"ps
-aux
|
grep
xxl-job-executor-sample | grep -v grep"
echo "=============== hadoop100 ==============="
ssh root@hadoop100 "ps -aux | grep xxl-job | grep -v
grep"
}
case $act in
start)
start
status
;;
stop)
stop
status
;;
restart)
stop
start
;;
status)
status
;;
esac
{
"job": {
"setting": {
"speed": {
"channel": 3
},
"errorLimit": {
"record": 0,
"percentage": 0.02
}
},
"content": [
{
"reader": {
"name": "mysqlreader",
"parameter": {
"username": "zhiyun",
"password": "zhiyun",
"column": [
"*"
],
"connection": [
{
"table": [
"c_org_busi"
],
"jdbcUrl": ["jdbc:mysql://zhiyun.pub:233
06/erp"
]
}
]
}
},
"writer": {
"name": "streamwriter",
"parameter": {
"print":true
}
}
}
]
}
}
{
"job": {"setting": {
"speed": {
"channel": 3
},
"errorLimit": {
"record": 0,
"percentage": 0.02
}
},
"content": [
{
"reader": {
"name": "mysqlreader",
"parameter": {
"username": "zhiyun",
"password": "zhiyun",
"column": [
"*"
],
"connection": [
{
"table": [
"c_org_busi"
],
"jdbcUrl": [
"jdbc:mysql://zhiyun.pub:233
06/erp"
]
}
]
}
},
"writer": {
"name": "hdfswriter",
"parameter": {
"defaultFS": "hdfs://hadoop100:8020",
"fileType": "orc",
"path":
"/zhiyun/shihaihong/ods/c_org_busi",
"fileName": "c_org_busi.data",
"column": [
{"name":"id","type": "int"},
{"name":"busno","type": "string"},{"name":"orgname","type": "string"},
{"name":"orgsubno","type":
"string"},
{"name":"orgtype","type": "string"},
{"name":"salegroup","type":
"string"},
{"name":"org_tran_code","type":
"string"},
{"name":"accno","type": "string"},
{"name":"sendtype","type":
"string"},
{"name":"sendday","type": "string"},
{"name":"maxday","type": "string"},
{"name":"minday","type": "string"},
{"name":"notes","type": "string"},
{"name":"stamp","type": "string"},
{"name":"status","type": "string"},
{"name":"customid","type":
"string"},
{"name":"whl_vendorno","type":
"string"},
{"name":"whlgroup","type":
"string"},
{"name":"rate","type": "string"},
{"name":"creditamt","type":
"string"},
{"name":"creditday","type":
"string"},
{"name":"peoples","type": "string"},
{"name":"area","type": "string"},
{"name":"abc","type": "string"},
{"name":"address","type": "string"},
{"name":"tel","type": "string"},
{"name":"principal","type":
"string"},
{"name":"identity_card","type":
"string"},
{"name":"mobil","type": "string"},
{"name":"corporation","type":
"string"},
{"name":"saler","type": "string"},
{"name":"createtime","type":
"string"},{"name":"bank","type": "string"},
{"name":"bankno","type": "string"},
{"name":"bak1","type": "string"},
{"name":"bak2","type": "string"},
{"name":"a_bak1","type": "string"},
{"name":"aa_bak1","type": "string"},
{"name":"b_bak1","type": "string"},
{"name":"bb_bak1","type": "string"},
{"name":"y_bak1","type": "string"},
{"name":"t_bak1","type": "string"},
{"name":"ym_bak1","type": "string"},
{"name":"tm_bak1","type": "string"},
{"name":"supervise_code","type":
"string"},
{"name":"monthrent","type":
"string"},
{"name":"wms_warehid","type":
"string"},
{"name":"settlement_cycle","type":
"string"},
{"name":"apply_cycle","type":
"string"},
{"name":"applydate","type":
"string"},
{"name":"accounttype","type":
"string"},
{"name":"applydate_last","type":
"string"},
{"name":"paymode","type": "string"},
{"name":"yaolian_flag","type":
"string"},
{"name":"org_longitude","type":
"string"},
{"name":"org_latitude","type":
"string"},
{"name":"org_province","type":
"string"},
{"name":"org_city","type":
"string"},
{"name":"org_area","type":
"string"},
{"name":"business_time","type":
"string"},{"name":"yaolian_group","type":
"string"},
{"name":"pacard_storeid","type":
"string"},
{"name":"opening_time","type":
"string"},
{"name":"ret_ent_id","type":
"string"},
{"name":"ent_id","type": "string"}
],
"writeMode": "truncate",
"fieldDelimiter": "\t"
}
}
}
]
}
}
-- 创建数据库
create database if not exists ods_shihaihong location
"/zhiyun/shihaihong/ods";
-- 创建对应的数据表
-- ODS 表都应该是外部表 防止建错表然后删表的情况create external table if not exists ods_shihaihong.c_org_busi(
id int,
busno string,
orgname string,
orgsubno string,
orgtype string,
salegroup string,
org_tran_code string,
accno string,
sendtype string,
sendday string,
maxday string,
minday string,
notes string,
stamp string,
status string,
customid string,
whl_vendorno string,
whlgroup string,
rate string,
creditamt string,
creditday string,
peoples string,
area string,
abc string,
address string,
tel string,
principal string,
identity_card string,
mobil string,
corporation string,
saler string,
createtime string,
bank string,
bankno string,
bak1 string,
bak2 string,
a_bak1 string,
aa_bak1 string,
b_bak1 string,
bb_bak1 string,
y_bak1 string,
t_bak1 string,ym_bak1 string,
tm_bak1 string,
supervise_code string,
monthrent string,
wms_warehid string,
settlement_cycle string,
apply_cycle string,
applydate string,
accounttype string,
applydate_last string,
paymode string,
yaolian_flag string,
org_longitude string,
org_latitude string,
org_province string,
org_city string,
org_area string,
business_time string,
yaolian_group string,
pacard_storeid string,
opening_time string,
ret_ent_id string,
ent_id string
) row format delimited fields terminated by "\t"
lines terminated by "\n"
stored as orc
location "/zhiyun/shihaihong/ods/c_org_busi"; 验证数据
#!/bin/bash
# 作用: 完成从编写配置文件到验证数据的整个过程
# 需要在任何节点都可以执行
echo "开始抽取 c_org_busi 门店信息表"
echo "生成配置文件"mkdir -p /zhiyun/shihaihong/jobs
echo '
{
"job": {
"setting": {
"speed": {
"channel": 3
},
"errorLimit": {
"record": 0,
"percentage": 0.02
}
},
"content": [
{
"reader": {
"name": "mysqlreader",
"parameter": {
"username": "zhiyun",
"password": "zhiyun",
"column": [
"*"
],
"connection": [
{
"table": [
"c_org_busi"
],
"jdbcUrl": [
"jdbc:mysql://zhiyun.pub:233
06/erp"
]
}
]
}
},
"writer": {
"name": "hdfswriter",
"parameter": {
"defaultFS": "hdfs://hadoop100:8020",
"fileType": "orc","path":
"/zhiyun/shihaihong/ods/c_org_busi",
"fileName": "c_org_busi.data",
"column": [
...
],
"writeMode": "truncate",
"fieldDelimiter": "\t"
}
}
}
]
}
}' > /zhiyun/shihaihong/jobs/c_org_busi.json
echo "生成 HDFS 路径"
hadoop fs -mkdir -p /zhiyun/shihaihong/ods/c_org_busi
echo "抽取数据"
python /opt/datax/bin/datax.py
/zhiyun/shihaihong/jobs/c_org_busi.json
echo "hive 建表"
hive -e '
-- 创建数据库
create database if not exists ods_shihaihong location
"/zhiyun/shihaihong/ods";
-- 创建对应的数据表
-- ODS 表都应该是外部表 防止建错表然后删表的情况
create external table if not exists ods_shihaihong.c_org_busi(
id int,
busno string,
orgname string,
orgsubno string,
orgtype string,
salegroup string,
org_tran_code string,
accno string,
sendtype string,
sendday string,
maxday string,
minday string,
notes string,stamp string,
status string,
customid string,
whl_vendorno string,
whlgroup string,
rate string,
creditamt string,
creditday string,
peoples string,
area string,
abc string,
address string,
tel string,
principal string,
identity_card string,
mobil string,
corporation string,
saler string,
createtime string,
bank string,
bankno string,
bak1 string,
bak2 string,
a_bak1 string,
aa_bak1 string,
b_bak1 string,
bb_bak1 string,
y_bak1 string,
t_bak1 string,
ym_bak1 string,
tm_bak1 string,
supervise_code string,
monthrent string,
wms_warehid string,
settlement_cycle string,
apply_cycle string,
applydate string,
accounttype string,
applydate_last string,
paymode string,
yaolian_flag string,
org_longitude string,
org_latitude string,org_province string,
org_city string,
org_area string,
business_time string,
yaolian_group string,
pacard_storeid string,
opening_time string,
ret_ent_id string,
ent_id string
) row format delimited fields terminated by "\t"
lines terminated by "\n"
stored as orc
location "/zhiyun/shihaihong/ods/c_org_busi";
'
echo "验证数据"
hive -e '
select count(1) from ods_shihaihong.c_org_busi;
select * from ods_shihaihong.c_org_busi limit 2;
'
echo "抽取完成!"
相关文章:
学习大数据DAY56 业务理解和第一次接入
作业1 1 了解行业名词 ERP CRM OA MES WMS RPA SAAS 了解每个系统的功能和应用 ERP 系统,(Enterprise Resource Planning,企业资源计划系统):ERP 系统 是一种用于管理企业各类资源的软件系统,包括生产管理…...
java线程池编程示例
程序功能 这段代码展示了如何使用 Java 线程池 来并发执行多个任务。通过创建一个固定大小为 3 的线程池,程序提交了 5 个任务,并让线程池中的线程并发处理这些任务。每个任务模拟了一个耗时操作,最后程序等待所有任务完成后关闭线程池。 …...
02 基于STM32的按键控制继电器驱动电机
本专栏所有源资料都免费获取,没有任何隐形消费。 注意事项:STM32仿真会存在各种各样BUG,且尽量按照同样仿真版本使用。本专栏所有的仿真都采用PROTEUS8.15。 本文已经配置好STM32F103C8T6系列,在PROTUES仿真里,32单片…...
网页本地存储
网页本地存储 <html> <script>//添加数据function add(){var text;textdocument.getElementById(text).value;indexlocalStorage.length1;localStorage.setItem(index,text);}//显示localStorage所有内容function showall(){storagelocalStorage;var length stor…...
SpringBoot2:web开发常用功能实现及原理解析-@ControllerAdvice实现全局异常统一处理
文章目录 前言1、工程包结构2、POM依赖3、Java代码 前言 本篇主要针对前后端分离的项目,做的一个统一响应包装、统一异常捕获处理。 在Spring里,我们可以使用ControllerAdvice来声明一些关于controller的全局性的东西,其用法主要有以下三点…...
DockerLinux安装DockerDocker基础
Linux软件安装 yum命令安装 通过yum命令安装软件,是直接把软件安装到Linux系统中 安装和卸载都比较麻烦,因为软件和系统是强关联的 Docker docker是一种容器技术,可以解决软件和系统强关联关系,使得软件的安装和卸载更方便,它可以将我们的应用以及依赖进行打包,制作出一个镜…...
macOS平台TensorFlow环境安装
1.安装xtarfile pip3 install xtarfile 2.安装 pip3 install matplotlib 3.安装jieba pip3 install jieba 4.安装 pip3 install tensorflow tensorflow安装成功...
全网最全 线程邮箱
线程邮箱的优缺点 优点 避免资源竞争:线程邮箱通过队列和互斥锁来管理线程间的通信,确保只有持有锁的线程可以访问和修改队列中的数据,从而避免了多个线程同时尝试修改同一资源时可能出现的竞争条件,减少了因资源竞争导致的死锁…...
Linux下rpm方式部署mysql(国产化生产环境无联网服务器部署实操)
请放心观看,已在正式环境部署验证,流程无问题! 所用系统为国产化麒麟银河 aarch64系统,部署时间2024年9月份! #查看服务器信息 #涉及生产服务器,所以输出信息隐藏了一部分[rootecs-xxxxx hdata]# uname -…...
【Python机器学习】NLP信息提取——正则模式
我们需要一种模式匹配算法,该算法可以识别与模式匹配的字符序列或词序列,以便从较长的文本字符串中“提取”它们。构建这种模式匹配算法的简单方法是在Python中,使用一系列if/else语句在字符串的逐个位置查找该符号(单词或字符&am…...
opc服务器与opc服务器如何通讯
OPC(OLE for Process Control,即过程控制对象链接)是一种工业自动化领域常用的通讯协议,它提供了一种标准化的方式,使得不同厂家的设备可以互相通讯。OPC服务器是运行在计算机上的软件程序,用于接收和处理来…...
指针 (六)
OK,书接上回,咱们继续: 一 . 函数指针变量 (1)函数指针变量的创建 首先我们得明白,什么是函数指针变量呢?从我们之前学习过的整型指针,数组指针的相关知识当中,通过类…...
Linux下vscode配置C++和python编译调试环境
Visual Studio Code (简称 VSCode) 是由微软开发的一款免费、开源、跨平台的代码编辑器。它支持 Windows、macOS 和 Linux 操作系统,并且内置对多种编程语言的支持,包括但不限于 C/C、Python、JavaScript、TypeScript、Java 和 Go 等。VSCode 主要用于编…...
OrionX GPU算力池助力AI OCR场景应用
01 AI OCR的历史及概念 OCR(Optical Character Recognition,光学字符识别)是指采用光学的方式将纸质文档中的文字转换成为黑白点阵的图像文件,通过检测暗、亮的模式确定其形状,然后用字符识别方法将形状翻译成计算机文…...
移动端如何实现智能语音交互
智能语音交互(Intelligent Speech Interaction)是基于语音识别、语音合成、自然语言理解等技术,为企业在多种实际应用场景下,赋予产品“能听、会说、懂你”式的智能人机交互功能。适用于智能问答、智能质检、法庭庭审实时记录、实…...
HTTPS:构建安全通信的基石
HTTPS(Hypertext Transfer Protocol Secure),作为互联网上安全通信的基石,通过在HTTP基础上引入SSL/TLS协议层,实现了数据传输的加密,确保了信息的机密性、完整性和真实性。这一过程涉及多个精细设计的步骤…...
OceanBase 企业版OMS 4.2.3的使用
OceanBase 企业版OMS 4.2.3的使用 一、界面说明 1.1 概览 1.2 数据迁移 1.3 数据同步 1.4 数据源管理 1.5 运维监控 1.6 系统管理 二、功能说明 注意: 在数据迁移与数据同步的功能中,如果涉及到增量操作: 1.需要使用sys租户的用…...
STM32中的计时与延时
前言 在裸机开发中,延时作为一种规定循环周期的方式经常被使用,其中尤以HAL库官方提供的HAL_Delay为甚。刚入门的小白可能会觉得既然有官方提供的延时函数,而且精度也还挺好,为什么不用呢?实际上HAL_Delay中有不少坑,而这些也只是HAL库中无数坑的其中一些。想从坑里跳出来…...
[论文笔记] CSFCN
摘要 上下文建模或多级特征融合方法已被证明可以有效提高语义分割性能。 然而,它们并不是专门处理像素上下文不匹配和空间特征不对齐的问题,并且高计算复杂度阻碍了它们在实时场景中的广泛应用。 在这项工作中,我们提出了一种轻量级的上下文…...
mac电脑命令行获取电量
在 macOS 上,有几个命令行工具可以用来获取电量信息,最常用的是 pmset 命令。你可以通过以下方式来查看电池状态和电量信息: 查看电池状态: pmset -g batt这个命令会返回类似下面的输出: Now drawing from Battery Pow…...
CentOS 7下‘Development Tools’和‘开发工具’组有区别吗?实测告诉你答案
CentOS 7下‘Development Tools’与‘开发工具’的隐藏关联:技术细节全解析在Linux系统管理中,yum的软件包组功能一直是个既实用又充满谜团的领域。特别是当系统语言环境与软件包元数据语言不一致时,开发者们常常会遇到一个有趣的现象&#x…...
UOS系统下WPS卸载不干净?手把手教你用命令行精准清理(附dpkg/apt组合拳)
UOS系统下WPS卸载不干净?手把手教你用命令行精准清理 在UOS系统日常使用中,WPS Office作为常用办公软件,有时因版本更新或功能调整需要彻底卸载。但不少用户发现,通过图形界面或简单命令卸载后,系统中仍残留配置文件、…...
极致精简,功能强大的PDF编辑工具
这是一款功能全面的PDF编辑工具 你只需要导入一份PDF格式文件 就可以快速的对它进行插入 批注编辑保护转换等各种操作 而且无需登录 也可以直接使用 在插入选项中可以进行插入文字图片 页面页眉页脚页码文档背景水印视频音频等 在批注选项中可以管理批注隐藏批注 高亮显示 文本…...
Simulink中Repeating Sequence锯齿波显示恒为0解决方案
锯齿波设置如图1时,其示波器显示恒为0(如图2)。图1图2于是新建模型,只添加Repeating Sequence模块,采用原始设置发现可以正常输出锯齿波,于是调整时间参数,发现当时间设置为≥[0 0.06]时可以正常…...
WTF Auto Layout? 实战:10个常见约束冲突案例解析与解决方案
WTF Auto Layout? 实战:10个常见约束冲突案例解析与解决方案 【免费下载链接】wtfautolayout The source code for Why The Failure, Auto Layout? 项目地址: https://gitcode.com/gh_mirrors/wt/wtfautolayout 在iOS开发中,Auto Layout是构建灵…...
DeepSeek代码风格检查避坑指南(内部审计报告首次披露:37个被忽略的合规红线)
更多请点击: https://intelliparadigm.com 第一章:DeepSeek代码风格检查的合规性本质与审计背景 DeepSeek代码风格检查并非单纯的技术偏好约束,而是嵌入研发治理链条中的合规性控制节点。其本质是将编程实践与组织级安全策略、行业监管要求&…...
基于STM32与LoRa的低功耗物联网气象站DIY全攻略
1. 项目概述:打造一个低功耗的家庭气象站前阵子想给家里的智能家居系统加点“环境感知”能力,琢磨着搞个能实时监测室外温湿度、风速风向的小玩意儿。市面上成品气象站要么数据出不来,要么功耗感人,不适合长期户外部署。于是&…...
深度解析:JetBrains IDE试用期重置机制的技术实现
深度解析:JetBrains IDE试用期重置机制的技术实现 【免费下载链接】ide-eval-resetter 项目地址: https://gitcode.com/gh_mirrors/id/ide-eval-resetter 在软件开发工作流中,JetBrains IDE试用期管理是一个常见的技术挑战,尤其是在多…...
Frida无Root Hook PC微信小程序源码(Electron+Chromium)
1. 这不是“破解”,而是一次对微信小程序运行机制的逆向观察 你有没有试过,在PC版微信里点开一个小程序,想看看它背后是怎么写的?比如某个电商小程序的优惠券逻辑、某个工具类小程序的数据渲染方式,甚至只是单纯好奇—…...
量子机器学习与傅里叶分析:革新期权定价的混合计算范式
1. 项目概述:当量子机器学习遇见金融定价在金融工程的核心地带,期权定价一直是个计算密集型的硬骨头。传统的蒙特卡洛模拟虽然通用,但为了达到足够的精度,动辄需要百万甚至千万次的路径模拟,计算成本高昂。近年来&…...
