如何解决“SecurityManager:身份验证已禁用;spark 分发集群中出现异常”?

Bim*_*lei 6 java apache-spark hadoop2

我在Linux(Ubuntu)环境中创建了一个Spark分发集群来运行Spark提交作业。我有3台机器(m1、s1和s2;m1是主机,s1和s2是从机)。

在主Spark和从Spark目录中../spark/conf/ spark-defaults.confspark-env.sh. 我已经配置了一切。

Spark-env.sh

export SPARK_MASTER_HOST=198.77.8.7
export SPARK_WORKER_HOST=198.77.8.12
export SPARK_WORKER_HOST=198.77.8.18
export SPARK_LOCAL_IP=198.77.8.7
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export SPARK_WORKER_CORES=8
Run Code Online (Sandbox Code Playgroud)

火花默认值.conf

spark.master yarn
spark.executor.memory 1g
spark.driver.memory 1g
spark.yarn.am.memory 1g
Run Code Online (Sandbox Code Playgroud)

工作命令是:

bin/spark-submit --master local[*] --deploy-mode client --class com.xyApp --executor-内存 15G --executor-cores 2 --driver-内存 15G /home/user/workspace/test 。罐

我正在获取输出文件,但是当我在集群模式下运行时,它给了我一个异常。命令是:

bin/spark-submit --master Spark://198.47.12.8:7077 --deploy-mode cluster --class com.xyApp --executor-内存 15G --executor-cores 2 --driver-内存 15G /home/用户/工作空间/test.jar

例外:

21/01/08 16:51:51 INFO SecurityManager: Changing modify acls groups to: 
21/01/08 16:51:51 INFO SecurityManager: SecurityManager: authentication disabled; ui acls disabled; users  with view permissions: Set(sys92); groups with view permissions: Set(); users  with modify permissions: Set(sys92); groups with modify permissions: Set()
21/01/08 16:51:51 WARN Utils: Service 'Driver' could not bind on a random free port. You may check whether configuring an appropriate binding address.
21/01/08 16:51:51 WARN Utils: Service 'Driver' could not bind on a random free port. You may check whether configuring an appropriate binding address.
21/01/08 16:51:51 WARN Utils: Service 'Driver' could not bind on a random free port. You may check whether configuring an appropriate binding address.
21/01/08 16:51:51 WARN Utils: Service 'Driver' could not bind on a random free port. You may check whether configuring an appropriate binding address.
21/01/08 16:51:51 WARN Utils: Service 'Driver' could not bind on a random free port. You may check whether configuring an appropriate binding address.
21/01/08 16:51:51 WARN Utils: Service 'Driver' could not bind on a random free port. You may check whether configuring an appropriate binding address.
21/01/08 16:51:51 WARN Utils: Service 'Driver' could not bind on a random free port. You may check whether configuring an appropriate binding address.
21/01/08 16:51:51 WARN Utils: Service 'Driver' could not bind on a random free port. You may check whether configuring an appropriate binding address.
21/01/08 16:51:51 WARN Utils: Service 'Driver' could not bind on a random free port. You may check whether configuring an appropriate binding address.
21/01/08 16:51:51 WARN Utils: Service 'Driver' could not bind on a random free port. You may check whether configuring an appropriate binding address.
21/01/08 16:51:51 WARN Utils: Service 'Driver' could not bind on a random free port. You may check whether configuring an appropriate binding address.
21/01/08 16:51:51 WARN Utils: Service 'Driver' could not bind on a random free port. You may check whether configuring an appropriate binding address.
21/01/08 16:51:51 WARN Utils: Service 'Driver' could not bind on a random free port. You may check whether configuring an appropriate binding address.
21/01/08 16:51:51 WARN Utils: Service 'Driver' could not bind on a random free port. You may check whether configuring an appropriate binding address.
21/01/08 16:51:51 WARN Utils: Service 'Driver' could not bind on a random free port. You may check whether configuring an appropriate binding address.
21/01/08 16:51:51 WARN Utils: Service 'Driver' could not bind on a random free port. You may check whether configuring an appropriate binding address.
Exception in thread "main" java.net.BindException: Cannot assign requested address: Service 'Driver' failed after 16 retries (on a random free port)! Consider explicitly setting the appropriate binding address for the service 'Driver' (for example spark.driver.bindAddress for SparkDriver) to the correct binding address.
    at sun.nio.ch.Net.bind0(Native Method)
    at sun.nio.ch.Net.bind(Net.java:461)
    at sun.nio.ch.Net.bind(Net.java:453)
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:222)
    at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:134)
    at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:550)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1334)
    at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:506)
    at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:491)
    at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:973)
    at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:248)
    at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:356)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.lang.Thread.run(Thread.java:748)
Run Code Online (Sandbox Code Playgroud)

我检查了所有3个系统的/etc/hosts文件(我认为这不是问题)。

主控-etc/hosts

#127.0.0.1  localhost
#127.0.1.1  mater1

198.77.8.7   mater1
198.77.8.12  slave1
198.77.8.18  slave2
Run Code Online (Sandbox Code Playgroud)

Salve1-etc/hosts

#127.0.0.1  localhost
#127.0.1.1  slave1

198.77.8.7   mater1
198.77.8.12  slave1
198.77.8.18  slave2
Run Code Online (Sandbox Code Playgroud)

Slave2-etc/主机

#127.0.0.1  localhost
#127.0.1.1  slave2

198.77.8.7   mater1
198.77.8.12  slave1
198.77.8.18  slave2
Run Code Online (Sandbox Code Playgroud)