Andrew Flint

How to Rebind Your Notebook's Interpreters

Blog Post created by Andrew Flint Advocate on Jul 20, 2017

On occasion, you may see that a paragraph refuses to run, and instead gives you this rather grudging error message:

 

java.net.ConnectException: Connection refused (Connection refused)

 

Generally, we see this happen when a notebook's interpreter (usually a Scala, Pyspark or SQL interpreter) has simply fallen over. The poor thing got all tuckered out and is basically taking a nap on you.

 

The good news it that you can restart the interpreter yourself, in just a few clicks. (I'll show you how.) The bad news is that the behind-the-scenes "memory" of your notebook will be lost, and you'll likely need to re-run many of your paragraphs (perhaps all of them), from top to bottom. Rest assured, the code in your notebook is safe, and any non-temporary files or datasets you wrote out to disk are still around. But all those ephemeral things -- Pyspark variables, Scala variables, Spark context, Zeppelin context, in-memory data frames, temporary SQL tables, etc. -- need to be recreated, by rerunning your paragraphs.

 

So, we need to restart (also called "rebind") the interpreters. How do we do that? It's pretty easy.

 

UPDATE (Dec 2017): With the release of AW 1.0.1, restarting your interpreters has become much easier, because Your Zeppelin notebook now has a Stop button. But if you prefer the more precise (or more tedious) process, keep reading here.

 

First, at the top of your notebook is the Interpreter Binding UI, hidden under a little gear icon in the upper right corner:

 

That opens a slide-down tray of interpreter settings, just above the first paragraph of your notebook.

 

Along the left side, you'll see an ordered list of interpreter groups, each shown as a blue button, and each with a little recycle-like icon next to it labeled "Restart". Find the interpreter group you need to restart (i.e., the one associated with the paragraph that is refusing to run correctly, and here's a hint: it's most likely the spark interpreter group), and just hit its restart button!

 

 

Now, click Save to dismiss the Interpreter Bindings UI, and start re-running your paragraphs. You should be back in action. If not, please contact our support line so we can help you through the problem.

 

NOTE: In AW 1.0.1, we added a new notebook toolbar button to reset all the active interpreters associated with your notebook. (That means we will shut them all down, and each interpreter will automatically restart itself when you run a paragraph calling for it.)

Outcomes