0

I have a working Jupyter server running on an EMR master node where I can run python and pyspark code with no issue. When trying to get the VS Code Python extension to connect to the very same Jupyter server, I get the following error:

Failed to connect to remote Jupyter notebook. 
Check that the Jupyter Server URI setting has a valid running server specified. 
http://***.***.***.***:8888/lab 
Error: Invalid response: 405 Method Not Allowed

I created my own self-signed certificate on the EMR cluster by following these instructions from IBM. Then added the certificate to Chrome following these stack overflow instructions another user linked to on GitHub.

From the bash terminal of the EMR master node:

# create key and cert
openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 365 -out certificate.pem
# combine key and cert
openssl pkcs12 -inkey key.pem -in certificate.pem -export -out certificate.p12

Downloaded certificate.p12 to my local computer, and then adding to Chrome: chrome://settings/privacy > Manage certificates > Import > Select and import certificate.p12 > Restarting VS Code.

I still get the same error.

  • Should I create either the key.pem and certificate.pem on my local then combine into a certificate?
  • Do I need to use the original .pem key issued when creating the EMR cluster?
4

1 回答 1

0

较新版本的 Jupyter 启动了类似于基于终端的lynx浏览器的东西。

无论我选择哪个终端 shell,在我启动 Jupyter 后输出都非常混乱,因为终端“浏览器”正在查看的“文档”与 Jupyter 服务器的输出混合在一起。

通过所有这些噪音,我可以使用箭头键的某种组合并enter以某种方式“导航”到终端中某处显示以下内容与 Jupyter 输出混合的点(通常突出显示,但取决于哪个终端程序):

cookie: username-***-***-***-***-****=2|1:0|10:***********|27:username-***-***-***-***-****|44:***********************************k1ZmE=|****************************1bef31e Allow? (Y/N/Always/neVer)

我键入A并按enter

有时,有时不会,我会在终端中短时间看到以下内容:

Data transfer complete  

然后我可以按下q并退出 Jupyter 启动的任何终端浏览器,只看到正常的 Jupyter 服务器输出。将完整的 url 复制到 Jupyter 服务器,将其粘贴到 VS Code Python 扩展python.dataScience.jupyterServerURI中。

之后一切都按预期工作。
不需要证书或密钥。

于 2020-04-19T20:21:56.173 回答