当前位置:   article > 正文

flink1.12.2 Windows下安装配置_starting a local cluster with one jobmanager proce

starting a local cluster with one jobmanager process and one taskmanager pro

flink1.12.2 Windows下安装配置

好久没有写文章了,发现flink版本没有.bat文件

flink.bat

  1. ::###############################################################################
  2. :: Licensed to the Apache Software Foundation (ASF) under one
  3. :: or more contributor license agreements. See the NOTICE file
  4. :: distributed with this work for additional information
  5. :: regarding copyright ownership. The ASF licenses this file
  6. :: to you under the Apache License, Version 2.0 (the
  7. :: "License"); you may not use this file except in compliance
  8. :: with the License. You may obtain a copy of the License at
  9. ::
  10. :: http://www.apache.org/licenses/LICENSE-2.0
  11. ::
  12. :: Unless required by applicable law or agreed to in writing, software
  13. :: distributed under the License is distributed on an "AS IS" BASIS,
  14. :: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. :: See the License for the specific language governing permissions and
  16. :: limitations under the License.
  17. ::###############################################################################
  18. @echo off
  19. setlocal
  20. SET bin=%~dp0
  21. SET FLINK_HOME=%bin%..
  22. SET FLINK_LIB_DIR=%FLINK_HOME%\lib
  23. SET FLINK_PLUGINS_DIR=%FLINK_HOME%\plugins
  24. SET JVM_ARGS=-Xmx512m
  25. SET FLINK_JM_CLASSPATH=%FLINK_LIB_DIR%\*
  26. java %JVM_ARGS% -cp "%FLINK_JM_CLASSPATH%"; org.apache.flink.client.cli.CliFrontend %*
  27. endlocal

start-cluster.bat

  1. ::###############################################################################
  2. :: Licensed to the Apache Software Foundation (ASF) under one
  3. :: or more contributor license agreements. See the NOTICE file
  4. :: distributed with this work for additional information
  5. :: regarding copyright ownership. The ASF licenses this file
  6. :: to you under the Apache License, Version 2.0 (the
  7. :: "License"); you may not use this file except in compliance
  8. :: with the License. You may obtain a copy of the License at
  9. ::
  10. :: http://www.apache.org/licenses/LICENSE-2.0
  11. ::
  12. :: Unless required by applicable law or agreed to in writing, software
  13. :: distributed under the License is distributed on an "AS IS" BASIS,
  14. :: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. :: See the License for the specific language governing permissions and
  16. :: limitations under the License.
  17. ::###############################################################################
  18. @echo off
  19. setlocal EnableDelayedExpansion
  20. SET bin=%~dp0
  21. SET FLINK_HOME=%bin%..
  22. SET FLINK_LIB_DIR=%FLINK_HOME%\lib
  23. SET FLINK_PLUGINS_DIR=%FLINK_HOME%\plugins
  24. SET FLINK_CONF_DIR=%FLINK_HOME%\conf
  25. SET FLINK_LOG_DIR=%FLINK_HOME%\log
  26. SET JVM_ARGS=-Xms1024m -Xmx1024m
  27. SET FLINK_CLASSPATH=%FLINK_LIB_DIR%\*
  28. SET logname_jm=flink-%username%-jobmanager.log
  29. SET logname_tm=flink-%username%-taskmanager.log
  30. SET log_jm=%FLINK_LOG_DIR%\%logname_jm%
  31. SET log_tm=%FLINK_LOG_DIR%\%logname_tm%
  32. SET outname_jm=flink-%username%-jobmanager.out
  33. SET outname_tm=flink-%username%-taskmanager.out
  34. SET out_jm=%FLINK_LOG_DIR%\%outname_jm%
  35. SET out_tm=%FLINK_LOG_DIR%\%outname_tm%
  36. SET log_setting_jm=-Dlog.file="%log_jm%" -Dlogback.configurationFile=file:"%FLINK_CONF_DIR%/logback.xml" -Dlog4j.configuration=file:"%FLINK_CONF_DIR%/log4j.properties"
  37. SET log_setting_tm=-Dlog.file="%log_tm%" -Dlogback.configurationFile=file:"%FLINK_CONF_DIR%/logback.xml" -Dlog4j.configuration=file:"%FLINK_CONF_DIR%/log4j.properties"
  38. :: Log rotation (quick and dirty)
  39. CD "%FLINK_LOG_DIR%"
  40. for /l %%x in (5, -1, 1) do (
  41. SET /A y = %%x+1
  42. RENAME "%logname_jm%.%%x" "%logname_jm%.!y!" 2> nul
  43. RENAME "%logname_tm%.%%x" "%logname_tm%.!y!" 2> nul
  44. RENAME "%outname_jm%.%%x" "%outname_jm%.!y!" 2> nul
  45. RENAME "%outname_tm%.%%x" "%outname_tm%.!y!" 2> nul
  46. )
  47. RENAME "%logname_jm%" "%logname_jm%.0" 2> nul
  48. RENAME "%logname_tm%" "%logname_tm%.0" 2> nul
  49. RENAME "%outname_jm%" "%outname_jm%.0" 2> nul
  50. RENAME "%outname_tm%" "%outname_tm%.0" 2> nul
  51. DEL "%logname_jm%.6" 2> nul
  52. DEL "%logname_tm%.6" 2> nul
  53. DEL "%outname_jm%.6" 2> nul
  54. DEL "%outname_tm%.6" 2> nul
  55. for %%X in (java.exe) do (set FOUND=%%~$PATH:X)
  56. if not defined FOUND (
  57. echo java.exe was not found in PATH variable
  58. goto :eof
  59. )
  60. echo Starting a local cluster with one JobManager process and one TaskManager process.
  61. echo You can terminate the processes via CTRL-C in the spawned shell windows.
  62. echo Web interface by default on http://localhost:8081/.
  63. start java %JVM_ARGS% %log_setting_jm% -cp "%FLINK_CLASSPATH%"; org.apache.flink.runtime.entrypoint.StandaloneSessionClusterEntrypoint --configDir "%FLINK_CONF_DIR%" > "%out_jm%" 2>&1
  64. start java %JVM_ARGS% %log_setting_tm% -cp "%FLINK_CLASSPATH%"; org.apache.flink.runtime.taskexecutor.TaskManagerRunner --configDir "%FLINK_CONF_DIR%" > "%out_tm%" 2>&1
  65. endlocal

其他一概如旧

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/764657
推荐阅读
相关标签
  

闽ICP备14008679号