拷贝完虚拟机的操作

打开master文件夹

找到这个,用记事本打开

第四行改为

然后打开

选择 未列出?

用户 root

密码 123456

右键打开终端

vi /etc/sysconfig/network-scripts/ifcfg-ens33

改IPADDR和GATEWAY

1.将IPADDR改为你master的ip地址

2.将GATEWAY的第三位改为IPADDR的第三位

然后刷新

systemctl restart network

1.连接mobaXter

2.修改/etc/hosts文件

vim /etc/hosts

三台如图

3.修改ssh映射

cd /root/.ssh/

rm -rf *

ssh-keygen

ssh-copy-id master

ssh-copy-id slave1

ssh-copy-id slave2

4.修改文件名(slave1和slave2)

cd /opt/module/

mv hadoop-3.1.3 hadoop

mv jdk1.8.0_161/ jdk

mv spark-3.5.0/ spark

5.传输环境变量配置文件

scp -r /etc/profile.d/my_env.sh slave1:/etc/profile.d/

scp -r /etc/profile.d/my_env.sh slave2:/etc/profile.d/

6.刷新配置文件

source /etc/profile

7.启动进程

(第一台)

cd /opt/bin/

./hdp.sh start

./zk.sh start

./kfk.sh start

如图代表正常

8.启动spark

cd /opt/module/spark/

sbin/start-all.sh

9,启动hiveserver2

cd /opt/module/hive/

bin/hiveserver2

9.Datagrap软件中插入文件

重新建表

drop table if exists ods_ads_info_full;

create external table if not exists ods_ads_info_full

(

id STRING comment '广告编号',

product_id STRING comment '产品id',

material_id STRING comment '素材id',

group_id STRING comment '广告组id',

ad_name STRING comment '广告名称',

material_url STRING comment '素材地址'

) PARTITIONED BY (`dt` STRING)

row format delimited fields terminated by '\t'

LOCATION '/warehouse/ad/ods/ods_ads_info_full';

drop table if exists ods_platform_info_full;

create external table if not exists ods_platform_info_full

(

id STRING comment '平台id',

platform_name_en STRING comment '平台名称(英文)',

platform_name_zh STRING comment '平台名称(中文)'

) PARTITIONED BY (`dt` STRING)

row format delimited fields terminated by '\t'

LOCATION '/warehouse/ad/ods/ods_platform_info_full';

drop table if exists ods_product_info_full;

create external table if not exists ods_product_info_full

(

id STRING comment '产品id',

name STRING comment '产品名称',

price decimal(16, 2) comment '产品价格'

) PARTITIONED BY (`dt` STRING)

row format delimited fields terminated by '\t'

LOCATION '/warehouse/ad/ods/ods_product_info_full';

drop table if exists ods_ads_platform_full;

create external table if not exists ods_ads_platform_full

(

id STRING comment '编号',

ad_id STRING comment '广告id',

platform_id STRING comment '平台id',

create_time STRING comment '创建时间',

cancel_time STRING comment '取消时间'

) PARTITIONED BY (`dt` STRING)

row format delimited fields terminated by '\t'

LOCATION '/warehouse/ad/ods/ods_ads_platform_full';

drop table if exists ods_server_host_full;

create external table if not exists ods_server_host_full

(

id STRING comment '编号',

ipv4 STRING comment 'ipv4地址'

) PARTITIONED BY (`dt` STRING)

row format delimited fields terminated by '\t'

LOCATION '/warehouse/ad/ods/ods_server_host_full';

drop table if exists ods_ad_log_inc;

create external table if not exists ods_ad_log_inc

(

time_local STRING comment '日志服务器收到的请求的时间',

request_method STRING comment 'HTTP请求方法',

request_uri STRING comment '请求路径',

status STRING comment '日志服务器相应状态',

server_addr STRING comment '日志服务器自身ip'

) PARTITIONED BY (`dt` STRING)

row format delimited fields terminated by '\u0001'

LOCATION '/warehouse/ad/ods/ods_ad_log_inc';

drop table if exists dim_ads_info_full;

create external table if not exists dim_ads_info_full

(

ad_id string comment '广告id',

ad_name string comment '广告名称',

product_id string comment '广告产品id',

product_name string comment '广告产品名称',

product_price decimal(16, 2) comment '广告产品价格',

material_id string comment '素材id',

material_url string comment '物料地址',

group_id string comment '广告组id'

) PARTITIONED BY (`dt` STRING)

STORED AS ORC

LOCATION '/warehouse/ad/dim/dim_ads_info_full'

TBLPROPERTIES ('orc.compress' = 'snappy');

insert overwrite table dim_ads_info_full partition (dt='2023-01-07')

select

ad.id,

ad_name,

product_id,

name,

price,

material_id,

material_url,

group_id

from

(

select

id,

ad_name,

product_id,

material_id,

group_id,

material_url

from ods_ads_info_full

where dt = '2023-01-07'

) ad

left join

(

select

id,

name,

price

from ods_product_info_full

where dt = '2023-01-07'

) pro

on ad.product_id = pro.id;

drop table if exists dim_platform_info_full;

create external table if not exists dim_platform_info_full

(

id STRING comment '平台id',

platform_name_en STRING comment '平台名称(英文)',

platform_name_zh STRING comment '平台名称(中文)'

) PARTITIONED BY (`dt` STRING)

STORED AS ORC

LOCATION '/warehouse/ad/dim/dim_platform_info_full'

TBLPROPERTIES ('orc.compress' = 'snappy');

insert overwrite table dim_platform_info_full partition (dt = '2023-01-07')

select

id,

platform_name_en,

platform_name_zh

from ods_platform_info_full

where dt = '2023-01-07';

有问题再扣我😀

相关推荐
SkyWalking中文站4 小时前
SkyWalking 11 与 BanyanDB 0.11:在存储引擎内部实现 Trace 尾部采样
运维·监控·自动化运维
姚不倒5 小时前
etcd 学习系列(二):集群架构 —— 3 节点是如何工作的
运维·架构·etcd
pt10436 小时前
网络自动化Python课程:Cisco PyATS网络自动化测试框架
运维·自动化
Johny_Zhao6 小时前
网络安全等级保护测评实施方案
linux·网络·人工智能·网络安全·信息安全·云计算·等保测评·系统运维·itsm
小袁拒绝摆烂7 小时前
Jenkins部署经验
运维·jenkins
落羽的落羽7 小时前
【AI】快速理解AI应用的相关名词概念
linux·c++·人工智能·python·计算机网络·算法
刚入门的大一新生7 小时前
Linux-进程控制
linux·运维·服务器·c++
上火的金鱼妹7 小时前
K8S基础组件作用和关系整理
linux·运维·服务器·kubernetes
Vcaker8 小时前
Linux学习25-harbor私有仓库部署
linux·运维·学习
刃神太酷啦8 小时前
Redis 进阶核心:持久化 (RDB/AOF)、事务与主从复制全解析----《Hello Redis!》(5)
linux·c语言·数据库·c++·redis·缓存·bootstrap