关注 spark技术分享,
撸spark源码 玩spark最佳实践

Spark Standalone – Using ZooKeeper for High-Availability of Master

Spark Standalone – Using ZooKeeper for High-Availability of Master

Tip
Read Recovery Mode to know the theory.

You’re going to start two standalone Masters.

You’ll need 4 terminals (adjust addresses as needed):

Start ZooKeeper.

Create a configuration file ha.conf with the content as follows:

Start the first standalone Master.

Start the second standalone Master.

Note
It is not possible to start another instance of standalone Master on the same machine using ./sbin/start-master.sh. The reason is that the script assumes one instance per machine only. We’re going to change the script to make it possible.

You can check how many instances you’re currently running using jps command as follows:

Start a standalone Worker.

Start Spark shell.

Wait till the Spark shell connects to an active standalone Master.

Find out which standalone Master is active (there can only be one). Kill it. Observe how the other standalone Master takes over and lets the Spark shell register with itself. Check out the master’s UI.

Optionally, kill the worker, make sure it goes away instantly in the active master’s logs.

赞(0) 打赏
未经允许不得转载:spark技术分享 » Spark Standalone – Using ZooKeeper for High-Availability of Master
分享到: 更多 (0)

关注公众号:spark技术分享

联系我们联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏