hey all,
I'm having some trouble with zeppelin using ephemeral ports. Here are the
details :

We want to run zeppelin in a docker container. We plan to run docker in
"--net=host" mode, which basically means containers
would have the network stack of the host and zeppelin would bind to ports
on the host and NOT the container.
The reason we are doing this is because YARN's Application Master or AM
cannot talk back to the container unless we
do net=host mode.

*Problem* :
Each user would get a docker container running zeppelin. There could be
multiple docker containers running zeppelin on the SAME
box. Each Zeppelin process tries to bind two ports - a) the http endpoint
b) the websocket endpoint
By default its 8080 and 8081 respectively.

Problem is when multiple zeppelin docker containers are running on same
host, all the containers tries to bind to the same ports
and I see "BindException : Address already in use".

*My two failed solutions: *
1. *My first solution* was to use ephemeral ports by specifying
*ZEPPELIN_PORT=0*
This would make the system pick an unused port and give it to zeppelin
server.
When I do this, I see zeppelin server(http endpoint) bind to an ephemeral
port.
But unfortunately zeppelin doesn't handle port=0 very well. The reason
being, websocket
tries to bind to port one more than ZEPPELIN_PORT, so its tries to bind to
port=1 and fails to bind,
because port=1 is a reserved port.
When I try to open zeppelin on browser, I get a blank white screen.

Here is quick log of websocket trying port=1 :
15/07/02 23:28:22 INFO socket.NotebookServer: Create zeppelin websocket on
* 0.0.0.0:1 <http://0.0.0.0:1/>*

2. *My second solution* was to make both *ZEPPELIN_PORT=0* and
*ZEPPELIN_WEBSOCKET_PORT=0*
so that both http and websocket can bind to ephemeral ports. If I do that,
I see that both ports are bind
to ephemeral ports when I do a netstat. However when I open zeppelin on
browser, I see the first page
but cannot create any notebook.

I think the reason is that this port=0 is passed internally in the code,
instead of the actual ports the servers bind to.

So guys, how do I make zeppelin servers work with ephemeral ports ?
Sorry about long email.

-- 
Thanks,
Ashwin

Reply via email to