본문 바로가기
HPC/ETC

Jupyter 설치 [ubuntu 16.04] 서버

by mirhenge 2020. 7. 26.

#apt-get install python3.6 python3-pip

#pip install jupyter
#jupyter-notebook --generate-config

 

# Key 값 생성

 

root@node02:~# ipython
Python 2.7.17 (default, Jul 20 2020, 15:37:01) 
Type "copyright", "credits" or "license" for more information.

 

IPython 5.10.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

 

In [1]: from notebook.auth import passwd

 

In [2]: passwd()
Enter password: 
Verify password: 
Out[2]: 'sha1:3b903223a9c2:9df884c2e1bd3bd78fab0246c5ba1ff96d219c35

 

In [3]: exit()
root@node02:~#

 

# jupyter_notebook_config.py 파일 수정

 

root@node02:~/.jupyter# pwd
/root/.jupyter
root@node02:~/.jupyter# 
root@node02:~/.jupyter# cat jupyter_notebook_config.py -> 맨 마지막 줄에 아래와 같이 입력

~~
~~

c.NotebookApp.password = 'sha1:3b903223a9c2:9df884c2e1bd3bd78fab0246c5ba1ff96d219c35' /*sha1 형식의 password*/

c.JupyterApp.config_file_name = 'jupyter_notebook_config.py'

c.NotebookApp.allow_origin = '*' /*외부에서 접속하는 것을 허용*/

c.NotebookApp.ip = '192.168.0.112' /*리눅스 서버의 IP 주소*/

c.NotebookApp.open_browser = False /*노트북실행시 웹브라우저(쥬피터가 실행되는)를 켤지 말지를 정합니다. 원격으로만 쓴다면 False 하면 됩니다.*/

root@node02:~/.jupyter#

 

# jubyter 백그라운드 실행

 

root@node02:~/.jupyter# jupyter-notebook --allow-root 1 > /dev/null 2 >& 1 

 

기타

root@node02:~/.jupyter# jupyter-notebook --allow-root 1> /dev/null 2>&1 &
[1] 51228
root@node02:~/.jupyter#
root@node02:~/.jupyter# jobs   <--- 백그라운드로 실행되고 있는 작업을 확인하는 명령어
[1]+ Running jupyter-notebook --allow-root > /dev/null 2>&1 &
root@node02:~/.jupyter#
root@node02:~/.jupyter# fg %1 <--- 백그라운드로 실행되고 있는 작업을 다시 포그라운드로 전환하는 명령어
jupyter-notebook --allow-root > /dev/null 2>&1 <--- 종료를 원할경우 Ctrl+c 로 종료

## 포그라운드로 실행하고 백그라운드로 변경하기
[ 포그라운드로 실행후 백그라운드 전환을 원할시 ctrl+z 를 입력후 bg 를 입력하면 백그라운드로 실행됨 ]

root@node02:~/.jupyter# jupyter-notebook --allow-root
[I 12:01:12.270 NotebookApp] Serving notebooks from local directory: /root/.jupyter
[I 12:01:12.270 NotebookApp] The Jupyter Notebook is running at:
[I 12:01:12.270 NotebookApp] http://192.168.0.112:8888/
[I 12:01:12.270 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
^Z
[1]+ Stopped jupyter-notebook --allow-root
root@node02:~/.jupyter# bg
[1]+ jupyter-notebook --allow-root &
root@node02:~/.jupyter#
root@node02:~/.jupyter# jobs
[1]+ Running jupyter-notebook --allow-root &
root@node02:~/.jupyter#

 

# jupyter-notebook 연결 확인

 

 

 

'HPC > ETC' 카테고리의 다른 글

ubuntu, xcat 디스크 파티션  (0) 2020.12.08
Jupyter 설치 (anaconda,python)  (0) 2020.07.27
DSS8440 IPU 장치 정보  (0) 2020.02.25
GPU 스펙 정리 자료  (0) 2019.10.15