————————–以下为解决——————–
原因:一般都是8081端口被占用
报错日志:仔细阅读可以看到8081端口被占用
2021-06-17 15:47:11,069 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - --------------------------------------------------------------------------------
2021-06-17 15:47:11,071 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - Preconfiguration:
2021-06-17 15:47:11,071 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] -
JM_RESOURCE_PARAMS extraction logs:
jvm_params: -Xmx1073741824 -Xms1073741824 -XX:MaxMetaspaceSize=268435456
logs: INFO [] - Loading configuration property: jobmanager.rpc.address, localhost
INFO [] - Loading configuration property: jobmanager.rpc.port, 6123
INFO [] - Loading configuration property: jobmanager.memory.process.size, 1600m
INFO [] - Loading configuration property: taskmanager.memory.process.size, 1728m
INFO [] - Loading configuration property: taskmanager.numberOfTaskSlots, 1
INFO [] - Loading configuration property: parallelism.default, 1
INFO [] - Loading configuration property: jobmanager.execution.failover-strategy, region
INFO [] - The derived from fraction jvm overhead memory (160.000mb (167772162 bytes)) is less than its min value 192.000mb (201326592 bytes), min value will be used instead
INFO [] - Final Master Memory configuration:
INFO [] - Total Process Memory: 1.563gb (1677721600 bytes)
INFO [] - Total Flink Memory: 1.125gb (1207959552 bytes)
INFO [] - JVM Heap: 1024.000mb (1073741824 bytes)
INFO [] - Off-heap: 128.000mb (134217728 bytes)
INFO [] - JVM Metaspace: 256.000mb (268435456 bytes)
INFO [] - JVM Overhead: 192.000mb (201326592 bytes)
2021-06-17 15:47:11,071 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - --------------------------------------------------------------------------------
2021-06-17 15:47:11,071 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - Starting StandaloneSessionClusterEntrypoint (Version: 1.12.4, Scala: 2.12, Rev:5364a6b, Date:2021-05-10T17:29:58+02:00)
2021-06-17 15:47:11,071 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - OS current user: root
2021-06-17 15:47:11,071 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - Current Hadoop/Kerberos user: <no hadoop dependency found>
2021-06-17 15:47:11,071 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - JVM: Java HotSpot(TM) 64-Bit Server VM - Oracle Corporation - 1.8/25.131-b11
2021-06-17 15:47:11,071 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - Maximum heap size: 981 MiBytes
2021-06-17 15:47:11,072 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - JAVA_HOME: /opt/jdk1.8.0_131
2021-06-17 15:47:11,072 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - No Hadoop Dependency available
2021-06-17 15:47:11,072 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - JVM Options:
2021-06-17 15:47:11,072 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - -Xmx1073741824
2021-06-17 15:47:11,072 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - -Xms1073741824
2021-06-17 15:47:11,072 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - -XX:MaxMetaspaceSize=268435456
2021-06-17 15:47:11,072 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - -Dlog.file=/root/app/flink-1.12.4/log/flink-root-standalonesession-2-t-hadoop04.log
2021-06-17 15:47:11,072 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - -Dlog4j.configuration=file:/root/app/flink-1.12.4/conf/log4j.properties
2021-06-17 15:47:11,072 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - -Dlog4j.configurationFile=file:/root/app/flink-1.12.4/conf/log4j.properties
2021-06-17 15:47:11,072 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - -Dlogback.configurationFile=file:/root/app/flink-1.12.4/conf/logback.xml
2021-06-17 15:47:11,072 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - Program Arguments:
2021-06-17 15:47:11,073 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - --configDir
2021-06-17 15:47:11,073 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - /root/app/flink-1.12.4/conf
2021-06-17 15:47:11,073 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - --executionMode
2021-06-17 15:47:11,073 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - cluster
2021-06-17 15:47:11,073 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - -D
2021-06-17 15:47:11,073 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - jobmanager.memory.off-heap.size=134217728b
2021-06-17 15:47:11,073 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - -D
2021-06-17 15:47:11,073 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - jobmanager.memory.jvm-overhead.min=201326592b
2021-06-17 15:47:11,073 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - -D
2021-06-17 15:47:11,073 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - jobmanager.memory.jvm-metaspace.size=268435456b
2021-06-17 15:47:11,073 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - -D
2021-06-17 15:47:11,074 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - jobmanager.memory.heap.size=1073741824b
2021-06-17 15:47:11,074 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - -D
2021-06-17 15:47:11,074 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - jobmanager.memory.jvm-overhead.max=201326592b
2021-06-17 15:47:11,074 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - Classpath: /root/app/flink-1.12.4/lib/flink-csv-1.12.4.jar:/root/app/flink-1.12.4/lib/flink-json-1.12.4.jar:/root/app/flink-1.12.4/lib/flink-shaded-zookeeper-3.4.14.jar:/root/app/flink-1.12.4/lib/flink-table_2.12-1.12.4.jar:/root/app/flink-1.12.4/lib/flink-table-blink_2.12-1.12.4.jar:/root/app/flink-1.12.4/lib/log4j-1.2-api-2.12.1.jar:/root/app/flink-1.12.4/lib/log4j-api-2.12.1.jar:/root/app/flink-1.12.4/lib/log4j-core-2.12.1.jar:/root/app/flink-1.12.4/lib/log4j-slf4j-impl-2.12.1.jar:/root/app/flink-1.12.4/lib/flink-dist_2.12-1.12.4.jar::/usr/hdp/current/hadoop-client/etc/hadoop::/usr/hdp/current/hbase-client/conf
2021-06-17 15:47:11,074 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - --------------------------------------------------------------------------------
2021-06-17 15:47:11,075 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - Registered UNIX signal handlers for [TERM, HUP, INT]
2021-06-17 15:47:11,086 INFO org.apache.flink.configuration.GlobalConfiguration [] - Loading configuration property: jobmanager.rpc.address, localhost
2021-06-17 15:47:11,086 INFO org.apache.flink.configuration.GlobalConfiguration [] - Loading configuration property: jobmanager.rpc.port, 6123
2021-06-17 15:47:11,087 INFO org.apache.flink.configuration.GlobalConfiguration [] - Loading configuration property: jobmanager.memory.process.size, 1600m
2021-06-17 15:47:11,087 INFO org.apache.flink.configuration.GlobalConfiguration [] - Loading configuration property: taskmanager.memory.process.size, 1728m
2021-06-17 15:47:11,087 INFO org.apache.flink.configuration.GlobalConfiguration [] - Loading configuration property: taskmanager.numberOfTaskSlots, 1
2021-06-17 15:47:11,087 INFO org.apache.flink.configuration.GlobalConfiguration [] - Loading configuration property: parallelism.default, 1
2021-06-17 15:47:11,088 INFO org.apache.flink.configuration.GlobalConfiguration [] - Loading configuration property: jobmanager.execution.failover-strategy, region
2021-06-17 15:47:11,098 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - Starting StandaloneSessionClusterEntrypoint.
2021-06-17 15:47:11,135 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - Install default filesystem.
2021-06-17 15:47:11,138 INFO org.apache.flink.core.fs.FileSystem [] - Hadoop is not in the classpath/dependencies. The extended set of supported File Systems via Hadoop is not available.
2021-06-17 15:47:11,169 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - Install security context.
2021-06-17 15:47:11,178 INFO org.apache.flink.runtime.security.modules.HadoopModuleFactory [] - Cannot create Hadoop Security Module because Hadoop cannot be found in the Classpath.
2021-06-17 15:47:11,183 INFO org.apache.flink.runtime.security.modules.JaasModule [] - Jaas file will be created as /tmp/jaas-8586299401098035028.conf.
2021-06-17 15:47:11,187 INFO org.apache.flink.runtime.security.contexts.HadoopSecurityContextFactory [] - Cannot install HadoopSecurityContext because Hadoop cannot be found in the Classpath.
2021-06-17 15:47:11,188 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - Initializing cluster services.
2021-06-17 15:47:11,216 INFO org.apache.flink.runtime.rpc.akka.AkkaRpcServiceUtils [] - Trying to start actor system, external address localhost:6123, bind address 0.0.0.0:6123.
2021-06-17 15:47:11,912 INFO akka.event.slf4j.Slf4jLogger [] - Slf4jLogger started
2021-06-17 15:47:11,934 INFO akka.remote.Remoting [] - Starting remoting
2021-06-17 15:47:12,046 INFO akka.remote.Remoting [] - Remoting started; listening on addresses :[akka.tcp://flink@localhost:6123]
2021-06-17 15:47:12,121 INFO org.apache.flink.runtime.rpc.akka.AkkaRpcServiceUtils [] - Actor system started at akka.tcp://flink@localhost:6123
2021-06-17 15:47:12,142 INFO org.apache.flink.configuration.Configuration [] - Config uses fallback configuration key 'jobmanager.rpc.address' instead of key 'rest.address'
2021-06-17 15:47:12,148 INFO org.apache.flink.runtime.blob.BlobServer [] - Created BLOB server storage directory /tmp/blobStore-8cefed3f-09e3-4b30-8bb2-6a56591ce518
2021-06-17 15:47:12,150 INFO org.apache.flink.runtime.blob.BlobServer [] - Started BLOB server at 0.0.0.0:3033 - max concurrent requests: 50 - max backlog: 1000
2021-06-17 15:47:12,159 INFO org.apache.flink.runtime.metrics.MetricRegistryImpl [] - No metrics reporter configured, no metrics will be exposed/reported.
2021-06-17 15:47:12,163 INFO org.apache.flink.runtime.rpc.akka.AkkaRpcServiceUtils [] - Trying to start actor system, external address localhost:0, bind address 0.0.0.0:0.
2021-06-17 15:47:12,176 INFO akka.event.slf4j.Slf4jLogger [] - Slf4jLogger started
2021-06-17 15:47:12,179 INFO akka.remote.Remoting [] - Starting remoting
2021-06-17 15:47:12,186 INFO akka.remote.Remoting [] - Remoting started; listening on addresses :[akka.tcp://flink-metrics@localhost:13451]
2021-06-17 15:47:12,196 INFO org.apache.flink.runtime.rpc.akka.AkkaRpcServiceUtils [] - Actor system started at akka.tcp://flink-metrics@localhost:13451
2021-06-17 15:47:12,206 INFO org.apache.flink.runtime.rpc.akka.AkkaRpcService [] - Starting RPC endpoint for org.apache.flink.runtime.metrics.dump.MetricQueryService at akka://flink-metrics/user/rpc/MetricQueryService .
2021-06-17 15:47:12,222 INFO org.apache.flink.runtime.dispatcher.FileArchivedExecutionGraphStore [] - Initializing FileArchivedExecutionGraphStore: Storage directory /tmp/executionGraphStore-9b02a413-956a-4227-9cc7-2fd9299c8f8c, expiration time 3600000, maximum cache size 52428800 bytes.
2021-06-17 15:47:12,257 INFO org.apache.flink.configuration.Configuration [] - Config uses fallback configuration key 'jobmanager.rpc.address' instead of key 'rest.address'
2021-06-17 15:47:12,258 INFO org.apache.flink.runtime.dispatcher.DispatcherRestEndpoint [] - Upload directory /tmp/flink-web-24e691ab-a46a-41ad-8638-aff031bb00f4/flink-web-upload does not exist.
2021-06-17 15:47:12,258 INFO org.apache.flink.runtime.dispatcher.DispatcherRestEndpoint [] - Created directory /tmp/flink-web-24e691ab-a46a-41ad-8638-aff031bb00f4/flink-web-upload for file uploads.
2021-06-17 15:47:12,259 INFO org.apache.flink.runtime.dispatcher.DispatcherRestEndpoint [] - Starting rest endpoint.
2021-06-17 15:47:12,486 INFO org.apache.flink.runtime.webmonitor.WebMonitorUtils [] - Determined location of main cluster component log file: /root/app/flink-1.12.4/log/flink-root-standalonesession-2-t-hadoop04.log
2021-06-17 15:47:12,487 INFO org.apache.flink.runtime.webmonitor.WebMonitorUtils [] - Determined location of main cluster component stdout file: /root/app/flink-1.12.4/log/flink-root-standalonesession-2-t-hadoop04.out
2021-06-17 15:47:12,610 INFO org.apache.flink.runtime.dispatcher.DispatcherRestEndpoint [] - Shutting down rest endpoint.
2021-06-17 15:47:12,614 INFO org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - Shutting StandaloneSessionClusterEntrypoint down with application status FAILED. Diagnostics org.apache.flink.util.FlinkException: Could not create the DispatcherResourceManagerComponent.
at org.apache.flink.runtime.entrypoint.component.DefaultDispatcherResourceManagerComponentFactory.create(DefaultDispatcherResourceManagerComponentFactory.java:275)
at org.apache.flink.runtime.entrypoint.ClusterEntrypoint.runCluster(ClusterEntrypoint.java:235)
at org.apache.flink.runtime.entrypoint.ClusterEntrypoint.lambda$startCluster$1(ClusterEntrypoint.java:178)
at org.apache.flink.runtime.security.contexts.NoOpSecurityContext.runSecured(NoOpSecurityContext.java:28)
at org.apache.flink.runtime.entrypoint.ClusterEntrypoint.startCluster(ClusterEntrypoint.java:175)
at org.apache.flink.runtime.entrypoint.ClusterEntrypoint.runClusterEntrypoint(ClusterEntrypoint.java:585)
at org.apache.flink.runtime.entrypoint.StandaloneSessionClusterEntrypoint.main(StandaloneSessionClusterEntrypoint.java:59)
Caused by: java.net.BindException: Could not start rest endpoint on any port in port range 8081
at org.apache.flink.runtime.rest.RestServerEndpoint.start(RestServerEndpoint.java:234)
at org.apache.flink.runtime.entrypoint.component.DefaultDispatcherResourceManagerComponentFactory.create(DefaultDispatcherResourceManagerComponentFactory.java:172)
... 6 more
.
2021-06-17 15:47:12,618 INFO org.apache.flink.runtime.blob.BlobServer [] - Stopped BLOB server at 0.0.0.0:3033
2021-06-17 15:47:12,619 INFO org.apache.flink.runtime.rpc.akka.AkkaRpcService [] - Stopping Akka RPC service.
2021-06-17 15:47:12,623 INFO org.apache.flink.runtime.rpc.akka.AkkaRpcService [] - Stopping Akka RPC service.
2021-06-17 15:47:12,635 INFO akka.remote.RemoteActorRefProvider$RemotingTerminator [] - Shutting down remote daemon.
2021-06-17 15:47:12,635 INFO akka.remote.RemoteActorRefProvider$RemotingTerminator [] - Shutting down remote daemon.
2021-06-17 15:47:12,637 INFO akka.remote.RemoteActorRefProvider$RemotingTerminator [] - Remote daemon shut down; proceeding with flushing remote transports.
2021-06-17 15:47:12,637 INFO akka.remote.RemoteActorRefProvider$RemotingTerminator [] - Remote daemon shut down; proceeding with flushing remote transports.
2021-06-17 15:47:12,653 INFO akka.remote.RemoteActorRefProvider$RemotingTerminator [] - Remoting shut down.
2021-06-17 15:47:12,653 INFO akka.remote.RemoteActorRefProvider$RemotingTerminator [] - Remoting shut down.
2021-06-17 15:47:12,672 INFO org.apache.flink.runtime.rpc.akka.AkkaRpcService [] - Stopped Akka RPC service.
2021-06-17 15:47:12,672 INFO org.apache.flink.runtime.rpc.akka.AkkaRpcService [] - Stopped Akka RPC service.
2021-06-17 15:47:12,673 ERROR org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - Could not start cluster entrypoint StandaloneSessionClusterEntrypoint.
org.apache.flink.runtime.entrypoint.ClusterEntrypointException: Failed to initialize the cluster entrypoint StandaloneSessionClusterEntrypoint.
at org.apache.flink.runtime.entrypoint.ClusterEntrypoint.startCluster(ClusterEntrypoint.java:201) ~[flink-dist_2.12-1.12.4.jar:1.12.4]
at org.apache.flink.runtime.entrypoint.ClusterEntrypoint.runClusterEntrypoint(ClusterEntrypoint.java:585) [flink-dist_2.12-1.12.4.jar:1.12.4]
at org.apache.flink.runtime.entrypoint.StandaloneSessionClusterEntrypoint.main(StandaloneSessionClusterEntrypoint.java:59) [flink-dist_2.12-1.12.4.jar:1.12.4]
Caused by: org.apache.flink.util.FlinkException: Could not create the DispatcherResourceManagerComponent.
at org.apache.flink.runtime.entrypoint.component.DefaultDispatcherResourceManagerComponentFactory.create(DefaultDispatcherResourceManagerComponentFactory.java:275) ~[flink-dist_2.12-1.12.4.jar:1.12.4]
at org.apache.flink.runtime.entrypoint.ClusterEntrypoint.runCluster(ClusterEntrypoint.java:235) ~[flink-dist_2.12-1.12.4.jar:1.12.4]
at org.apache.flink.runtime.entrypoint.ClusterEntrypoint.lambda$startCluster$1(ClusterEntrypoint.java:178) ~[flink-dist_2.12-1.12.4.jar:1.12.4]
at org.apache.flink.runtime.security.contexts.NoOpSecurityContext.runSecured(NoOpSecurityContext.java:28) ~[flink-dist_2.12-1.12.4.jar:1.12.4]
at org.apache.flink.runtime.entrypoint.ClusterEntrypoint.startCluster(ClusterEntrypoint.java:175) ~[flink-dist_2.12-1.12.4.jar:1.12.4]
... 2 more
Caused by: java.net.BindException: Could not start rest endpoint on any port in port range 8081
at org.apache.flink.runtime.rest.RestServerEndpoint.start(RestServerEndpoint.java:234) ~[flink-dist_2.12-1.12.4.jar:1.12.4]
at org.apache.flink.runtime.entrypoint.component.DefaultDispatcherResourceManagerComponentFactory.create(DefaultDispatcherResourceManagerComponentFactory.java:172) ~[flink-dist_2.12-1.12.4.jar:1.12.4]
at org.apache.flink.runtime.entrypoint.ClusterEntrypoint.runCluster(ClusterEntrypoint.java:235) ~[flink-dist_2.12-1.12.4.jar:1.12.4]
at org.apache.flink.runtime.entrypoint.ClusterEntrypoint.lambda$startCluster$1(ClusterEntrypoint.java:178) ~[flink-dist_2.12-1.12.4.jar:1.12.4]
at org.apache.flink.runtime.security.contexts.NoOpSecurityContext.runSecured(NoOpSecurityContext.java:28) ~[flink-dist_2.12-1.12.4.jar:1.12.4]
at org.apache.flink.runtime.entrypoint.ClusterEntrypoint.startCluster(ClusterEntrypoint.java:175) ~[flink-dist_2.12-1.12.4.jar:1.12.4]
... 2 more
4.解决:找出占用8081端口的进程号 并kill掉
进程号是8495
kill掉8495进程
最后可以正常访问8081 webUI界面
版权声明:本文为weixin_41239249原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。