学习大数据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…...

2024桥梁科技两江论坛——第二届桥梁工程安全与韧性学术会议
文章目录 一、会议详情二、重要信息三、大会介绍四、出席嘉宾五、征稿主题六、咨询 一、会议详情 二、重要信息 大会官网:https://ais.cn/u/vEbMBz提交检索:EI Compendex、IEEE Xplore、Scopus 三、大会介绍 2024年桥梁科技两江论坛——第二届桥梁工程…...

性能测试-jmeter的控制器(十六)
一、if控制器 需求:使用“用户自定义变量”定义name变量,值可以是“baidu”或“itcast”,使用变量值,控制是否访问对应网站。 1、步骤: 在测试计划中添加用户定义的变量name,取值可为baidu或itcast添加两个http请求:…...

直播开播极速流,如何有效接入?
如何有效接入开播极速流?为什么你的直播流速会逐渐下降?开播极速流实际上是我们流速的巅峰阶段,这一阶段的流量构成通常是70%的老粉丝和30%的新粉丝。你是否意识到这一点呢? 在直播开始时,欢迎新老粉丝的互动很重要。比…...

stm32 W25Q数据存储
提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 文章目录 前言一、cubemx配置二、keil中文件修改与配置三、几个重要函数的说明四、DMA方式传输(待写)总结 前言 W25Q128 容量为128位 128/8 16 也就…...

深度学习的笔记
1. 从huggingface上仅下载pytorch模型权重和配置文件到服务器 import os import shutil from huggingface_hub import snapshot_download# 直接指定模型和下载路径 model_name openai/clip-vit-base-patch32 download_path /home/xxx/.cache/huggingface/hub/models--anas-a…...

音视频入门基础:AAC专题(8)——FFmpeg源码中计算AAC裸流AVStream的time_base的实现
一、引言 本文讲解FFmpeg源码对AAC裸流行解复用(解封装)时,其AVStream的time_base是怎样被计算出来的。 二、FFmpeg源码中计算AAC裸流AVStream的time_base的实现 FFmpeg对AAC裸流进行解复用(解封装)时,其…...

React 组件的基本使用,useState 状态变量的使用
React 组件 组件是什么 ##### 概念:一个组件就是用户界面的一部分,它可以有自己的逻辑和外观,组件之间可以相互嵌套,也可以多次复用。 在 React,一个组件就是首字母大写的函数,内部存放了组件的逻辑和视…...

空洞骑士 Hollow Knight 攻略
文章目录 Part.I IntroductionPart.II 攻略Chap.I 地图Chap.II 护符Chap.III BOSSChap.IV 魔法 Reference Part.I Introduction 《空洞骑士》是独立团队 Team Cherry 开发的一款 2D 类银河恶魔城动作冒险游戏。本文记录笔者玩此游戏所积累的一些经验。 「在《空洞骑士》中打造…...

CSP-J 算法基础 广度优先搜索BFS
文章目录 前言广度优先搜索是什么广度优先搜索的实现BFS 的具体编程实现举例:广度优先搜索的具体步骤初始状态:步骤 1:加入起点节点 1步骤 2:访问队列中的节点 1,加入其邻居节点 2 和 4步骤 3:访问队列中的…...

What is new in C# 7,8,9,10
目录 Whats new in C# 7 C# 7 in Visual Studio 2017 Out Variables Pattern Matching Tuples (System.ValueTuple) Deconstruct解构 Local Functions Ref Returns and Locals Expression Bodied Members Throw Expressions Generated Async R…...