ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

Windows安装Flink20220915

2022-09-15 10:33:56  阅读:249  来源: 互联网

标签:SET License Windows FLINK Flink20220915 logname tm% 安装 jm%


1.官方下载地址  https://flink.apache.org/zh/downloads.html#apache-flink-1144

   最好用国内镜像下载比较快

  下载后对压缩包解压,路径自定义

2.安装包中是不含启动bat的,需要我们新建

flink.bat

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 ::############################################################################### ::  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. ::###############################################################################   @echo off setlocal   SET bin=%~dp0 SET FLINK_HOME=%bin%.. SET FLINK_LIB_DIR=%FLINK_HOME%\lib SET FLINK_PLUGINS_DIR=%FLINK_HOME%\plugins   SET JVM_ARGS=-Xmx512m   SET FLINK_JM_CLASSPATH=%FLINK_LIB_DIR%\*   java %JVM_ARGS% -cp "%FLINK_JM_CLASSPATH%"; org.apache.flink.client.cli.CliFrontend %*   endlocal

start-cluster.bat 启动批处理文件

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 ::############################################################################### ::  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. ::###############################################################################   @echo off setlocal EnableDelayedExpansion   SET bin=%~dp0 SET FLINK_HOME=%bin%.. SET FLINK_LIB_DIR=%FLINK_HOME%\lib SET FLINK_PLUGINS_DIR=%FLINK_HOME%\plugins SET FLINK_CONF_DIR=%FLINK_HOME%\conf SET FLINK_LOG_DIR=%FLINK_HOME%\log   SET JVM_ARGS=-Xms1024m -Xmx1024m   SET FLINK_CLASSPATH=%FLINK_LIB_DIR%\*   SET logname_jm=flink-%username%-jobmanager.log SET logname_tm=flink-%username%-taskmanager.log SET log_jm=%FLINK_LOG_DIR%\%logname_jm% SET log_tm=%FLINK_LOG_DIR%\%logname_tm% SET outname_jm=flink-%username%-jobmanager.out SET outname_tm=flink-%username%-taskmanager.out SET out_jm=%FLINK_LOG_DIR%\%outname_jm% SET out_tm=%FLINK_LOG_DIR%\%outname_tm%   SET log_setting_jm=-Dlog.file="%log_jm%" -Dlogback.configurationFile=file:"%FLINK_CONF_DIR%/logback.xml" -Dlog4j.configuration=file:"%FLINK_CONF_DIR%/log4j.properties" SET log_setting_tm=-Dlog.file="%log_tm%" -Dlogback.configurationFile=file:"%FLINK_CONF_DIR%/logback.xml" -Dlog4j.configuration=file:"%FLINK_CONF_DIR%/log4j.properties"   :: Log rotation (quick and dirty) CD "%FLINK_LOG_DIR%" for /l %%x in (5, -1, 1) do ( SET /A y = %%x+1 RENAME "%logname_jm%.%%x" "%logname_jm%.!y!" 2> nul RENAME "%logname_tm%.%%x" "%logname_tm%.!y!" 2> nul RENAME "%outname_jm%.%%x" "%outname_jm%.!y!"  2> nul RENAME "%outname_tm%.%%x" "%outname_tm%.!y!"  2> nul ) RENAME "%logname_jm%" "%logname_jm%.0"  2> nul RENAME "%logname_tm%" "%logname_tm%.0"  2> nul RENAME "%outname_jm%" "%outname_jm%.0"  2> nul RENAME "%outname_tm%" "%outname_tm%.0"  2> nul DEL "%logname_jm%.6"  2> nul DEL "%logname_tm%.6"  2> nul DEL "%outname_jm%.6"  2> nul DEL "%outname_tm%.6"  2> nul   for %%X in (java.exe) do (set FOUND=%%~$PATH:X) if not defined FOUND (     echo java.exe was not found in PATH variable     goto :eof )   echo Starting a local cluster with one JobManager process and one TaskManager process.   echo You can terminate the processes via CTRL-C in the spawned shell windows.   echo Web interface by default on http://localhost:8081/.   start java %JVM_ARGS% %log_setting_jm% -cp "%FLINK_CLASSPATH%"; org.apache.flink.runtime.entrypoint.StandaloneSessionClusterEntrypoint --configDir "%FLINK_CONF_DIR%" "%out_jm%" 2>&1 start java %JVM_ARGS% %log_setting_tm% -cp "%FLINK_CLASSPATH%"; org.apache.flink.runtime.taskexecutor.TaskManagerRunner --configDir "%FLINK_CONF_DIR%" "%out_tm%" 2>&1   endlocal

3.运行测试

cmd命令,定位到刚刚Flink的安装包bin目录下,执行

start-cluster.bat
http://localhost:8081/   可以访问后台UI界面

 

 

 

 


参考 https://www.cnblogs.com/M-MAKI/p/16145552.html

标签:SET,License,Windows,FLINK,Flink20220915,logname,tm%,安装,jm%
来源: https://www.cnblogs.com/smallfa/p/16695644.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有