动物园管理员恢复新主人后,Spark Worker的“死亡”状态

时间:2019-01-24 12:04:14

标签: scala apache-spark virtual-machine apache-zookeeper

我已经在3个不同的虚拟盒子中成功设置了zookeeper并独立运行。启动Zookeeper和Spark Master没问题。

IP地址为/etc/hosts

192.168.1.10 master1
192.168.1.11 master2
192.168.1.12 master3

在所有机器上使用以下代码启动我的奴隶(火花工人)以连接到我的主人。

./sbin/start-slave.sh spark://master1:7077,master2:17077,master3:7077

“奴隶”(火花工作者)已在第一个主机上成功连接,但是当我杀死或停止活动的主机时,将开始恢复,但是在恢复之后,只有具有与当前主机相同IP地址的工人仍在运行,几分钟后,其他工人被炸死。

该项目的位置都位于用户/usr/local/下的spuser

通过以下方式打开所有需要的端口

sudo firewall-cmd --zone=public --add-port=<port_number>/tcp --permanent

火花配置

我也有一个/usr/local/spark/highavability.conf

spark.deploy.recoveryMode=ZOOKEEPER
spark.deploy.zookeeper.url=192.168.1.10:2181,192.168.1.11:2181,192.168.1.12:2181
spark.deploy.zookeeper.dir=/usr/local/spark/spark

并在所有机器上使用运行主服务器

./sbin/start-master.sh -h <master_ip> -p 7077 --webui-port 8080 --properties-file ha.conf

在另一条注释中,此代码在/usr/local/spark/conf/spark-env.sh上的插入与上述代码相同

export SPARK_DAEMON_JAVA_OPTS="-Dspark.deploy.recoveryMode=ZOOKEEPER -Dspark.deploy.zookeeper.url=master:2181,slave1:2181,slave2:2181 -Dspark.deploy.zookeeper.dir=/home/usr/local/spark/spark"

Zookeeper配置

我在/usr/local/zookeeper/conf/zoo.cfg上有这个

# The number of milliseconds of each tick
tickTime=2000

# The number of ticks that the initial
# synchronization phase can take
initLimit=10

# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5

# the directory where the snapshot is stored.
dataDir=/home/dd/zookeeper/data/

# the port at which the clients will connect
clientPort=2181
dataLogDir=/home/dd/zookeeper/logs/

server.1=master1:2888:3888
server.2=master2:2889:3889
server.3=master3:2890:3890

预计所有工作人员都必须已连接并具有alive状态的新当选主服务器,但只有具有相同IP地址的工作人员已连接并具有alive状态。

0 个答案:

没有答案
相关问题