I am new to bokeh (< 1 day) but quite impressed. It looks like what I am looking for: to publish a time series from Redis and display it on a browser using bokeh server.
Before trying a time-series I tried to go through the tutorial by trying to run the server on an interface other than localhost:
bokeh serve --address 10.10.4.252 --host 10.10.4.252:5006 /home/aliz/mybokeh/ /home/aliz/mybokeh/apps/*
Now if I put say sliders.py (from the git) in apps, I can access it from the browser on another host at 10.10.10.200 on the same subnet. Great!
But what I have not been able to do is to post a graph to the bokeh server and access it from a browser on 10.10.10.200. I tried to run the following example from the tutorial:
#!/usr/bin/python
from bokeh.plotting import figure, output_server, show
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
output_server(session_id=‘None’, url=‘http://10.10.4.252:5006’, app_path=’/home/aliz/mybokeh/app/’, autopush=False)
p = figure(title=“simple line example”, x_axis_label=‘x’, y_axis_label=‘y’)
p.line(x, y, legend=“Temp.”, line_width=2)
show(p)
But I get:
INFO:bokeh.client.connection:Failed to connect to server: HTTPError(404, ‘Not Found’, HTTPResponse(_body=None,buffer=<_io.BytesIO object at 0x7f71358bcbf0>,code=404,effective_url=‘http://10.10.4.252:5006/home/aliz/mybokeh/app/ws?bokeh-protocol-version=1.0&bokeh-session-id=None’,error=HTTPError(…),headers=<tornado.httputil.HTTPHeaders object at 0x7f7135869f90>,reason=‘Not Found’,request=<tornado.httpclient.HTTPRequest object at 0x7f7135869c10>,request_time=0.004470109939575195,time_info={}))
Traceback (most recent call last):
File “./b.py”, line 8, in
show(p)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 279, in show
return _show_with_state(obj, _state, browser, new)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 290, in _show_with_state
_show_server_with_state(obj, state, new, controller)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 314, in _show_server_with_state
push(state=state)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 457, in push
document=document, io_loop=io_loop)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 400, in _push_to_server
session = push_session(document, session_id=session_id, url=url, app_path=app_path, io_loop=io_loop)
File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 64, in push_session
session.push(document)
File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 270, in push
raise IOError(“Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)”)
IOError: Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)
I think the problem is with show(p) which seems to work only if you are accessing the plot on a browser on localhost. But I have not been able to figure out what API to use.
Suggestions about this problem as well on plotting time-series published by Redis are greatly appreciated.