当前位置:网站首页>Data warehouse 4.0 notes - user behavior data generation
Data warehouse 4.0 notes - user behavior data generation
2022-07-23 11:49:00 【Silky】
( Shang Silicon Valley digital warehouse 4.0 video )
1 Cluster synchronization script
[[email protected] ~]$ mkdir bin
stay /home/atguigu/bin Create under directory xsync file , So that the global call
[[email protected] ~]$ cd /home/yu/bin
[[email protected] ~]$ vim xsync

Write the following code in this file
#!/bin/bash
#1. Judge the number of parameters
if [ $# -lt 1 ]
then
echo Not Enough Arguement!
exit;
fi
#2. Traverse all machines in the cluster
for host in node02 node03 node04
do
echo ==================== $host ====================
#3. Traverse all directories , Send... One by one
for file in [email protected]
do
#4 Judge whether the file exists
if [ -e $file ]
then
#5. Get parent directory
pdir=$(cd -P $(dirname $file); pwd)
#6. Get the name of the current file
fname=$(basename $file)
ssh $host "mkdir -p $pdir"
rsync -av $pdir/$fname $host:$pdir
else
echo $file does not exists!
fi
done
done

Modify the script xsync Have Execution Authority
[[email protected] bin]$ chmod 777 xsync

2 SSH Password free login configuration

node02 Generate public and private keys on :
[[email protected] .ssh]$ ssh-keygen -t rsa

Copy to the target machine to be logged in without secret :
[[email protected] .ssh]$ ssh-copy-id node02
[[email protected] .ssh]$ ssh-copy-id node03
[[email protected] .ssh]$ ssh-copy-id node04

Just test it

3 Analog data
3.1 Generate logs
take application.yml、gmall2020-mock-log-2021-01-22.jar、path.json、logback.xml Upload to hadoop102 Of /opt/module/applog Under the table of contents
establish applog route
[[email protected] module]$ mkdir /opt/module/applog
Drag the four files directly to /opt/module/applog Catalog
[[email protected] applog]$ java -jar gmall2020-mock-log-2021-01-22.jar

Check the log 
3.2 Cluster log generation script
Write the following in the script
#!/bin/bash
for i in hadoop102 hadoop103; do
echo "========== $i =========="
ssh $i "cd /opt/module/applog/; java -jar gmall2020-mock-log-2021-01-22.jar >/dev/null 2>&1 &"
done

Modify the permissions [[email protected] bin]$ chmod 777 lg.sh

Delete previous logs
[[email protected] bin]$ cd /opt/module/applog/
[[email protected] applog]$ rm -rf log

Sync information 
104 I don't want it , Delete 
103 There are 
Execute the script , See if it works

Check the log 

边栏推荐
- mysql树形结构递归查询
- 按照日期进行累加sql
- Understanding of the decoder in the transformer in NLP
- 数仓4.0笔记——用户行为数据采集一
- sql-labs 5-6通关笔记
- upload-lab第1~4关
- [radiology] bugfix: when GLCM features: indexerror: arrays used as indexes must be of integer (or Boolean) type
- 数字藏品开发/元宇宙数字藏品开发
- Development of digital collection system: Baidu AI pays tribute to Air China
- SQL labs 5-6 customs clearance notes
猜你喜欢

Genesis provided a loan of US $2.36 billion to Sanya capital

Development of digital collection system: enterprise layout meta universe digital collection

xtu-ctf Challenges-Reverse 1、2

Custom MVC (Part 2)

数字藏品系统开发:企业布局元宇宙数字藏品

文件上传漏洞常见绕过方式

Security problems of FileInfo in PHP file upload

数仓4.0笔记——数仓建模

Data warehouse 4.0 notes - user behavior data collection II

Data warehouse 4.0 notes - business data collection
随机推荐
[untitled]
NepCTF2022 Writeup
按照日期进行累加sql
数字藏品系统开发:企业布局元宇宙数字藏品
[uiautomation] key instructions (and three call methods) + common mouse actions +sendkeys+inspect learning
VMware uses wireless network card NAT to access the Internet under Windows
Genesis曾向三箭资本提供23.6亿美元的贷款
Chinese interpretation of notepad++ background color adjustment options
Sqli lab 1-16 notes with customs clearance
编译原理-语法分析详解
Yarn capacity scheduler settings
Data warehouse 4.0 notes - Data Warehouse Modeling
Eth transfer times reached a one month high
Wordcount of the first Flink program
CTF web common software installation and environment construction
数仓4.0笔记——用户行为数据采集四
MySQL Index & execution plan
[radiology] bugfix: when GLCM features: indexerror: arrays used as indexes must be of integer (or Boolean) type
Typescript introduction
第一个FLINK程序之WordCount