当前位置: 首页 > news >正文

Flink Operator 使用指南 之 全局配置

背景

在上一个章节中已经介绍了基本的Flink-Operator安装,但是在实际的数据中台的项目中,用户可能希望看到Flink Operator的运行日志情况,当然这可以通过修改Flink-Operator POD的文件实现卷挂载的形势将日志输出到宿主机器的指定目录下,但是这种办法对数据中台的产品不是特别友好,因此我们需要将Operator服务的日志输出到Kafka Appender中;因此我们需要修改Flink Operator的helm中的values配置文件文件,达成我们的目标.

默认情况下Flink Operator不支持Kafka Appender日志输出,为了支持改能力,需要在flink-operator的镜像编译的时候添加kafka依赖,这里小编是在flink-kubernetes-operator模块的pom.xml文件中添加如下配置

<!--kafka版本信息-->
<properties>
    <kafka-clients.version>2.2.0</kafka-clients.version>
</properties>
...
<!--kafka clients依赖-->
<dependency>
    <groupId>org.apache.kafka</groupId>
    <artifactId>kafka-clients</artifactId>
    <version>${kafka-clients.version}</version>
</dependency>

然后对flink-operator重新进行打包编译,重新发布flink-kubernetes-operator镜像即可

日志采集

可以这么理解flink-operator服务是一个flink 任务提交的客户端,在设计的时候会在提交作业的时候允许用户覆盖log4j-console.propertieslog4j-operator.properties配置文件,其中如果用户需要采集k8s作业容器的运行日志可以尝试配置log4j-console.properties配置文件,如果是希望查看flink-operator服务本身的日志需要覆盖log4j-operator.properties配置文件。

################################################################################
#  Licensed to the Apache Software Foundation (ASF) under one
#  or more contributor license agreements.  See the NOTICE file
#  distributed with this work for additional information
#  regarding copyright ownership.  The ASF licenses this file
#  to you under the Apache License, Version 2.0 (the
#  "License"); you may not use this file except in compliance
#  with the License.  You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
# limitations under the License.
################################################################################

---

# List of kubernetes namespaces to watch for FlinkDeployment changes, empty means all namespaces.
# When enabled RBAC is only created for said namespaces, otherwise it is done for the cluster scope.
# watchNamespaces: ["flink"]

image:
  repository: ghcr.io/apache/flink-kubernetes-operator
  pullPolicy: IfNotPresent
  tag: "51eeae1"
  # If image digest is set then it takes precedence and the image tag will be ignored
  # digest: ""

imagePullSecrets: []

# Replicas must be 1 unless operator leader election is configured
replicas: 1

# Strategy type must be Recreate unless leader election is configured
strategy:
  type: Recreate

rbac:
  create: true
  # kubernetes.rest-service.exposed.type: NodePort requires
  # list permission for nodes at the cluster scope.
  # Set create to true if you are using NodePort type.
  nodesRule:
    create: false
  operatorRole:
    create: true
    name: "flink-operator"
  operatorRoleBinding:
    create: true
    name: "flink-operator-role-binding"
  jobRole

相关文章:

  • Unity开发之C#基础-File文件读取
  • WPF基础DataGrid控件
  • Docker Golang 开发环境搭建指南
  • 电动汽车充放电V2G模型MATLAB代码
  • 【论文阅读笔记】Deep learning for time series classification: a review
  • HTML+CSS+ElementUI搭建个人博客静态页面展示(纯前端)
  • 笔记59:序列到序列学习Seq2seq
  • 如何用 GPTs 帮你写科研项目申请书?
  • gitlab利用CI多工程持续构建
  • C/C++ 实现Windows注册表操作
  • 网络知识学习(笔记二)
  • laravel引入element-ui后,blade模板中使用elementui时,事件未生效问题(下载element-ui到本地直接引入项目)
  • QT小记:The QColor ctor taking ints is cheaper than the one taking string literals
  • Mysql之聚合函数
  • C# - Opencv应用(2) 之矩阵Mat使用[矩阵创建、图像显示、像素读取与赋值]
  • ts 联合react 实现ajax的封装,refreshtoken的功能
  • Go语言中获取协程ID
  • [深度学习]卷积神经网络的概念,入门构建(代码实例)
  • 算法笔记-第十章-动态规划2
  • 安全领航,共筑敏捷开发新时代【云驻共创】
  • 习近平会见哥伦比亚总统佩特罗
  • 多家外资看好中国市场!野村建议“战术超配”,花旗上调恒指目标价
  • 习近平举行仪式欢迎巴西总统卢拉访华
  • 伊朗外长称正与美国进行“善意”的会谈
  • 鄂州:锁死中小学教师编制总量,核减小学编制五百名增至初中
  • 公安部部署“昆仑2025”专项工作,严打环食药等领域突出犯罪