Jupyter Notebook Setup - Nantawat6510545543/big-data-summary GitHub Wiki
Assume you are logged in as user: hadoop
sudo apt install python3-pippip3 install jupyterlabIf you see a externally-managed-environment error, use one of the alternatives below.
sudo apt install pipx
pipx ensurepath
pipx install jupyterlabLaunch:
~/.local/bin/jupyter-labsudo apt install python3-venv
python3 -m venv ~/venv
source ~/venv/bin/activate
pip install jupyterlabLaunch:
~/jupyter-env/bin/jupyter-lab~/.local/bin/jupyter server --generate-config
nano /home/hadoop/.jupyter/jupyter_server_config.py~/.local/bin/jupyter-lab server --generate-config
nano /home/hadoop/.jupyter/jupyter_lab_config.pyAdd:
c.NotebookApp.token = ''
c.NotebookApp.password = u''
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8887
c.NotebookApp.ip = '0.0.0.0'
c.NotebookApp.allow_origin = '*'
c.NotebookApp.allow_remote_access = Truesudo nano /etc/systemd/system/Jupyter.servicePaste:
[Unit]
Description=Jupyter Lab
[Service]
Type=simple
User=hadoop
Group=hadoop
WorkingDirectory=/home/hadoop
ExecStart=/home/hadoop/.local/bin/jupyter-lab --config=/home/hadoop/.jupyter/jupyter_server_config.py
Restart=on-failure
RestartSec=5s
[Install]
WantedBy=multi-user.targetsudo systemctl enable Jupyter.service
sudo systemctl daemon-reload
sudo systemctl start Jupyter.service
sudo systemctl status Jupyter.service
sudo ufw allow 8887/tcpThen visit:
http://<your-vm-ip>:8887