赞
踩
在POM文件中加入jar包,注意一定要把scope注释掉,否则会访问不了。
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-runtime-web_2.12</artifactId>
<version>1.12.7</version>
<!-- <scope>test</scope>-->
</dependency>
本地调试模式,代码如下,通过绑定一个端口范围来展示,防止本地端口被占用出现异常。
val conf = new Configuration()
import org.apache.flink.configuration.RestOptions
conf.setString(RestOptions.BIND_PORT, "8081-8089")
val env = StreamExecutionEnvironment.createLocalEnvironmentWithWebUI(conf)
这样在浏览器中输入localhost:8081就会出现了。
pom中引入包
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.5</version>
</dependency>
在resources中配置log4j.properties
log4j.rootLogger=INFO,stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。