• Flink学习笔记——scala shell


    Flink也和和spark-shell类似的交互式开发模式

    bin/start-scala-shell.sh yarn
    Starting Flink Shell:
    20/03/14 14:34:07 INFO configuration.GlobalConfiguration: Loading configuration property: jobmanager.rpc.address, localhost
    20/03/14 14:34:07 INFO configuration.GlobalConfiguration: Loading configuration property: jobmanager.rpc.port, 6123
    20/03/14 14:34:07 INFO configuration.GlobalConfiguration: Loading configuration property: jobmanager.heap.size, 1024m
    20/03/14 14:34:07 INFO configuration.GlobalConfiguration: Loading configuration property: taskmanager.memory.process.size, 1568m
    20/03/14 14:34:07 INFO configuration.GlobalConfiguration: Loading configuration property: taskmanager.numberOfTaskSlots, 1
    20/03/14 14:34:07 INFO configuration.GlobalConfiguration: Loading configuration property: parallelism.default, 1
    20/03/14 14:34:07 INFO configuration.GlobalConfiguration: Loading configuration property: jobmanager.execution.failover-strategy, region
    20/03/14 14:34:07 INFO cli.FlinkYarnSessionCli: Found Yarn properties file under /tmp/.yarn-properties-lintong.
    20/03/14 14:34:07 WARN cli.FlinkYarnSessionCli: The configuration directory ('/home/lintong/software/apache/flink-1.10.0/conf') already contains a LOG4J config file.If you want to use logback, then please delete or rename the log configuration file.
    
    Connecting to Flink cluster (host: localhost, port: 6123).
    
    
                             ▒▓██▓██▒
                         ▓████▒▒█▓▒▓███▓▒
                      ▓███▓░░        ▒▒▒▓██▒  ▒
                    ░██▒   ▒▒▓▓█▓▓▒░      ▒████
                    ██▒         ░▒▓███▒    ▒█▒█▒
                      ░▓█            ███   ▓░▒██
                        ▓█       ▒▒▒▒▒▓██▓░▒░▓▓█
                      █░ █   ▒▒░       ███▓▓█ ▒█▒▒▒
                      ████░   ▒▓█▓      ██▒▒▒ ▓███▒
                   ░▒█▓▓██       ▓█▒    ▓█▒▓██▓ ░█░
             ▓░▒▓████▒ ██         ▒█    █▓░▒█▒░▒█▒
            ███▓░██▓  ▓█           █   █▓ ▒▓█▓▓█▒
          ░██▓  ░█░            █  █▒ ▒█████▓▒ ██▓░▒
         ███░ ░ █░          ▓ ░█ █████▒░░    ░█░▓  ▓░
        ██▓█ ▒▒▓▒          ▓███████▓░       ▒█▒ ▒▓ ▓██▓
     ▒██▓ ▓█ █▓█       ░▒█████▓▓▒░         ██▒▒  █ ▒  ▓█▒
     ▓█▓  ▓█ ██▓ ░▓▓▓▓▓▓▓▒              ▒██▓           ░█▒
     ▓█    █ ▓███▓▒░              ░▓▓▓███▓          ░▒░ ▓█
     ██▓    ██▒    ░▒▓▓███▓▓▓▓▓██████▓▒            ▓███  █
    ▓███▒ ███   ░▓▓▒░░   ░▓████▓░                  ░▒▓▒  █▓
    █▓▒▒▓▓██  ░▒▒░░░▒▒▒▒▓██▓░                            █▓
    ██ ▓░▒█   ▓▓▓▓▒░░  ▒█▓       ▒▓▓██▓    ▓▒          ▒▒▓
    ▓█▓ ▓▒█  █▓░  ░▒▓▓██▒            ░▓█▒   ▒▒▒░▒▒▓█████▒
     ██░ ▓█▒█▒  ▒▓▓▒  ▓█                █░      ░░░░   ░█▒
     ▓█   ▒█▓   ░     █░                ▒█              █▓
      █▓   ██         █░                 ▓▓        ▒█▓▓▓▒█░
       █▓ ░▓██░       ▓▒                  ▓█▓▒░░░▒▓█░    ▒█
        ██   ▓█▓░      ▒                    ░▒█▒██▒      ▓▓
         ▓█▒   ▒█▓▒░                         ▒▒ █▒█▓▒▒░░▒██
          ░██▒    ▒▓▓▒                     ▓██▓▒█▒ ░▓▓▓▓▒█▓
            ░▓██▒                          ▓░  ▒█▓█  ░░▒▒▒
                ▒▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░▓▓  ▓░▒█░
    
                  F L I N K - S C A L A - S H E L L
    

    读文件

    scala> val dataSet = benv.readTextFile("hdfs://master:8020/user/lintong/logs/test/test.log")
    20/03/14 14:49:07 INFO configuration.GlobalConfiguration: Loading configuration property: jobmanager.rpc.address, localhost
    20/03/14 14:49:07 INFO configuration.GlobalConfiguration: Loading configuration property: jobmanager.rpc.port, 6123
    20/03/14 14:49:07 INFO configuration.GlobalConfiguration: Loading configuration property: jobmanager.heap.size, 1024m
    20/03/14 14:49:07 INFO configuration.GlobalConfiguration: Loading configuration property: taskmanager.memory.process.size, 1568m
    20/03/14 14:49:07 INFO configuration.GlobalConfiguration: Loading configuration property: taskmanager.numberOfTaskSlots, 1
    20/03/14 14:49:07 INFO configuration.GlobalConfiguration: Loading configuration property: parallelism.default, 1
    20/03/14 14:49:07 INFO configuration.GlobalConfiguration: Loading configuration property: jobmanager.execution.failover-strategy, region
    dataSet: org.apache.flink.api.scala.DataSet[String] = org.apache.flink.api.scala.DataSet@13e5b262
    

    打印

    scala> dataSet.print()
    20/03/14 14:49:10 INFO java.ExecutionEnvironment: The job has 0 registered types and 0 default Kryo serializers
    20/03/14 14:49:11 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
    20/03/14 14:49:11 INFO client.RMProxy: Connecting to ResourceManager at master/192.168.2.105:8032
    20/03/14 14:49:11 INFO yarn.YarnClusterDescriptor: No path for the flink jar passed. Using the location of class org.apache.flink.yarn.YarnClusterDescriptor to locate the jar
    20/03/14 14:49:11 INFO yarn.YarnClusterDescriptor: Found Web Interface master:36441 of application 'application_1584163852090_0002'.
    1
    2
    3
    4
    
  • 相关阅读:
    第三方支付集成
    文件并发(日志处理)--队列--Redis+Log4Net
    ReportingServies——SQLServer报表开发综合实例
    C#开发可以可视化操作的windows服务
    4、ASP.NET MVC入门到精通——NHibernate构建一个ASP.NET MVC应用程序
    Lucene.net站内搜索—6、站内搜索第二版
    Lucene.net站内搜索—5、搜索引擎第一版实现
    Lucene.net站内搜索—4、搜索引擎第一版技术储备(简单介绍Log4Net、生产者消费者模式)
    谈谈爱情——祭奠那逝去的青春
    Lucene.net站内搜索—3、最简单搜索引擎代码
  • 原文地址:https://www.cnblogs.com/tonglin0325/p/12492176.html
Copyright © 2020-2023  润新知