Flink 版本 | 说明 |
1.11 | 不支持 |
1.13 | 支持 hive 版本2.2.0、2.3.2、2.3.5、3.1.1 |
1.14 | 不支持 |
hive --service metastore
:开启 Hive Metastore 服务。ps -ef|grep metastore
:查询 Hive Metastore 服务是否已开启。_dc
,单击新建 Hive Catalog。
上传4个配置文件 hive-site.xml ,hdfs-site.xml ,hivemetastore-site.xml ,hiveserver2-site.xml 配置文件下载,其中 hive-site.xml 中需要添加 urls 的地址。catalog_name.database_name
。CREATE DATABASE IF NOT EXISTS `hiveCatalogName`.`databaseName`;
catalog_name.database_name.table_name
。CREATE TABLE IF NOT EXISTS `hiveCatalogName`.`databaseName`.`tableName` (user_id INT,item_id INT,category_id INT,-- ts AS localtimestamp,-- WATERMARK FOR ts AS ts,behavior VARCHAR) WITH ('connector' = 'datagen','rows-per-second' = '1', -- 每秒产生的数据条数'fields.user_id.kind' = 'sequence', -- 有界序列(结束后自动停止输出)'fields.user_id.start' = '1', -- 序列的起始值'fields.user_id.end' = '10000', -- 序列的终止值'fields.item_id.kind' = 'random', -- 无界的随机数'fields.item_id.min' = '1', -- 随机数的最小值'fields.item_id.max' = '1000', -- 随机数的最大值'fields.category_id.kind' = 'random', -- 无界的随机数'fields.category_id.min' = '1', -- 随机数的最小值'fields.category_id.max' = '1000', -- 随机数的最大值'fields.behavior.length' = '5' -- 随机字符串的长度);
INSERT INTO`hiveCatalogName`.`databaseName`.`sink_tableName`SELECT*FROM`hiveCatalogName`.`databaseName`.`source_tableName`;
useradd flinkgroupadd supergroupusermod -a -G supergroup flinkhdfs dfsadmin -refreshUserToGroupsMappings
<property><name>hive.metastore.authorization.storage.checks</name><value>true</value><description>Should the metastore do authorization checks againstthe underlying storage for operations like drop-partition (disallowthe drop-partition if the user in question doesn't have permissionsto delete the corresponding directory on the storage).</description><property>
本页内容是否解决了您的问题?