我正在尝试在Linux服务器上安装Jupyterhub。所以我有sudo权利,但我不是root。我已经配置了JupyterHub及其配置,因此可以在单用户模式下运行它(也可以从其他文件夹运行)。
但是,如此处所述,尝试启动多用户时出现此错误:official documentation link。
[在使用configurable-http-proxy
和jupyterhub.sqlite
之前,我遇到了同样的问题-问题是多用户脚本试图将此文件保存在系统目录(/lib/systemd/system/jupyterhub.service
或/etc/systemd/system/jupyterhub.service
)中。
我更改了jupyter_config.py
中的此类参数:
## url for the database. e.g. `sqlite:///jupyterhub.sqlite`
c.JupyterHub.db_url = 'sqlite:////data/jupyterhub/jupyterhub.sqlite'
## DEPRECATED since version 0.8. Use ConfigurableHTTPProxy.command
#c.JupyterHub.proxy_cmd = []
c.ConfigurableHTTPProxy.command = '/data/anaconda3/envs/fraud/bin/configurable-http-proxy'
所以我对jupyterhub-proxy.pid
尝试了相同的方法:
## File to write PID Useful for daemonizing JupyterHub.
c.JupyterHub.pid_file = '/data/jupyterhub/jupyterhub-proxy.pid'
但是看起来JupyterHub忽略了它,仍然尝试将其保存到系统目录中!我在print
函数的jupyterhub/proxy.py
中添加了_write_pid_file(self)
:
self.log.info("Writing log: %s", self.pid_file)
self.log.info("Writing log: %s", os.path.abspath(os.curdir))
输出:
[[I 2019-12-19 20:23:50.289 JupyterHub代理:562]编写代理pid文件:jupyterhub-proxy.pid
[[I 2019-12-19 20:23:50.290 JupyterHub代理:564]写作日志:/
我的主意-也许我需要更改另一个配置参数,但找不到任何相关的参数。
它对我来说在jupyterhub配置文件中设置c.ConfigurableHTTPProxy.pid_file
参数。