Apache spark 如何在Apache Spark中连接主服务器和从服务器?(独立模式)
我正在使用教程页面以独立模式安装Spark 1-我已通过以下方式创建了master:Apache spark 如何在Apache Spark中连接主服务器和从服务器?(独立模式),apache-spark,Apache Spark,我正在使用教程页面以独立模式安装Spark 1-我已通过以下方式创建了master: ./sbin/start-master.sh 2-我已通过以下方式开始工作: ./bin/spark-class org.apache.spark.deploy.worker.Worker spark://ubuntu:7077 注:spark://ubuntu:7077是我的主机名,我可以在主机WebUI中看到它 问题:通过第二个命令,工作进程成功启动。但它不能与主人联系。它会反复尝试,然后发出以下消息:
./sbin/start-master.sh
2-我已通过以下方式开始工作:
./bin/spark-class org.apache.spark.deploy.worker.Worker spark://ubuntu:7077
注:spark://ubuntu:7077
是我的主机名,我可以在主机WebUI
中看到它
问题:通过第二个命令,工作进程成功启动。但它不能与主人联系。它会反复尝试,然后发出以下消息:
15/02/08 11:30:04 WARN Remoting: Tried to associate with unreachable remote address [akka.tcp://sparkMaster@ubuntu:7077]. Address is now gated for 5000 ms, all messages to this address will be delivered to dead letters. Reason: Connection refused: ubuntu/127.0.1.1:7077
15/02/08 11:30:04 INFO RemoteActorRefProvider$RemoteDeadLetterActorRef: Message [org.apache.spark.deploy.DeployMessages$RegisterWorker] from Actor[akka://sparkWorker/user/Worker#-1296628173] to Actor[akka://sparkWorker/deadLetters] was not delivered. [20] dead letters encountered. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
15/02/08 11:31:15 ERROR Worker: All masters are unresponsive! Giving up.
有什么问题
谢谢我通常从模板开始。我设置了我需要的属性。对于简单群集,您需要:
- SPARK_MASTER_IP
> sbin/start-all.sh
> bin/spark-shell
您可以在
$SPARK\u HOME/conf/SPARK env.sh中设置export SPARK\u LOCAL\u IP=“You IP”#来设置SPARK绑定到这个节点上的IP地址
,在我的例子中,在独立模式下使用SPARK 2.4.7,我已经使用ssh-keygen创建了一个无密码的ssh密钥,但在启动集群时仍然需要工作密码
我所做的就是按照这里的说明做
这条线解决了这个问题:
ssh copy id-i$HOME/.ssh/id_rsa.pubuser@server-ip您的spark-env.sh配置是什么?您是否已将从属ip添加到从属文件?启动worker后,我将其ip添加到主系统的从属文件中。但我不知道spark-env.sh!在教程页面中没有任何内容。在spark-env.sh中,我可以看到一些变量,如spark\u MASTER\u IP。我必须用“UbuntuIP”来设置我的主机是否安装在它上面?看看,这可能有一些解决这个问题的技巧。谢谢你的回答。我在SPARK-env.sh文件中有SPARK_MASTER_IP=192.168.84.128,在slaves文件中有192.168.84.129。我将这两个文件复制到worker和master的conf文件夹中。但是,当我在主系统中执行./start-all.sh时,我收到以下错误:启动org.apache.spark.deploy.master.master,登录到/home/omid/Programs/spark-1.2.0/sbin/。/logs/spark-omid-org.apache.spark.deploy.master.master-1-ubuntu.out 192.168.84.129:ssh:connect to host 192.168.84.129端口22:Connection requesed我可以从主系统ping 192.168.84.129。这还不够吗?ssh连接是什么?不,机器必须能够在没有密钥的情况下通过ssh连接。安装OpenSSH,生成ssh密钥(私有和公共),并将它们添加到所有这些密钥的授权密钥中。噢,非常感谢。我可以在主WebUI中看到我的工作人员。太好了。工人需要在各自的机器上手动启动吗?