8. debmule Jupyter
Jupyter¶
apt install pip
pip install jupyter pandas
mkdir /mnt/data/services/notebooks
cd /mnt/data/services/notebooks
jupyter notebook --generate-config
jupyter notebook --ip 192.168.1.39 --port 8888
Modifier la configuration¶
Générer le fichier de configuration avec jupyter_notebook_config.py
Ajouter au fichier /root/.jupyter/jupyter_notebook_config.py
nano /root/.jupyter/jupyter_notebook_config.py
c.NotebookApp.ip = '192.168.1.39'
c.NotebookApp.port = 8888
c.NotebookApp.allow_remote_access = True
Accès par mot de passe (plutot que token)¶
Jupyter as a service¶
Démarrage automatique au démarrage et en cas de crash
Y ajouter ce contenu
[Unit]
Description=Jupyter Notebooks
[Service]
Type=simple
PIDFile=/run/jupyter.pid
ExecStart=/usr/local/bin/jupyter lab --config=/root/.jupyter/jupyter_notebook_config.py --allow-root
User=root
Group=root
WorkingDirectory=/mnt/data/notebooks/
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
Executer les commandes
Vérifier l'état du service
http://192.168.1.39:8888/lab