flink1.12 sql sql-client命令行连接yarn

  • Post author:
  • Post category:其他




step1 开辟资源

这里 fcqueue 是yarn资源队列名称 默认是default

yarn-session.sh -s 2 -jm 1024 -tm 2048 -nm yydd -qu fcqueddue
// 如果需要后台运行: yarn-session.sh -s 2 -jm 1024 -tm 2048 -nm yydd -qu fcqueude -d



step2 提交任务

sql-client.sh embedded -s yarn-session



使用demo

-- 建表
CREATE TABLE a(
  dt STRING COMMENT 'dt',
  recordId STRING COMMENT 'recordId',
  relatedFace BIGINT COMMENT 'relatedFace',
  json STRING COMMENT 'json',
  extRecordId STRING COMMENT 'extRecordId',
  capTime BIGINT COMMENT 'capTime',
  channelId STRING COMMENT 'channelId'
) WITH (
 'connector' = 'kafka',
 'topic' = 'fc_body_in_record',
 'properties.zookeeper.connect' = '192.169.0.8:2181/kafka',
 'properties.bootstrap.servers' = '192.169.0.20:9090',
 'format' = 'json',
 'properties.group.id' = 'group-id-1-1655976263361',
 'scan.startup.mode' = 'earliest-offset'
);

-- 查询
select * from a;



版权声明:本文为weixin_46580067原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。