728x90

출처

Node.js 설치

[bluesanta@localhost ~]$ cd ~
[bluesanta@localhost ~]$ curl -sL https://rpm.nodesource.com/setup_18.x -o nodesource_setup.sh
[bluesanta@localhost ~]$ sudo bash nodesource_setup.sh
   
2025-04-21 16:22:50 - Repository is configured and updated.
2025-04-21 16:22:50 - You can use N|solid Runtime as a node.js alternative
2025-04-21 16:22:50 - To install N|solid Runtime, run: dnf install nsolid -y
2025-04-21 16:22:50 - Run 'dnf install nodejs -y' to complete the installation.
[bluesanta@localhost ~]$ sudo dnf install nodejs openssl -y
[bluesanta@localhost ~]$ node --version
v18.20.8
[bluesanta@localhost ~]$ sudo npm install -g configurable-http-proxy

jupyterhub 설치

[bluesanta@localhost ~]$ su - 
[root@localhost ~]# pip3.11 install sudospawner

jupyterhub 관리자 계정 생성

[bluesanta@localhost ~]$ sudo groupadd jupyterhub
[bluesanta@localhost ~]$ sudo useradd -g jupyterhub -s /bin/bash -m jupyterhubapp

jupyterhub 관리자 계정 로그인

[bluesanta@localhost ~]$ su - jupyterhubapp
암호:
[jupyterhubapp@localhost ~]$ 

jupyterhub 실행

[jupyterhubapp@localhost ~]$ jupyterhub
[I 2025-04-21 16:59:44.638 JupyterHub app:3354] Running JupyterHub version 5.3.0
[I 2025-04-21 16:59:44.638 JupyterHub app:3384] Using Authenticator: jupyterhub.auth.PAMAuthenticator-5.3.0
[I 2025-04-21 16:59:44.638 JupyterHub app:3384] Using Spawner: jupyterhub.spawner.LocalProcessSpawner-5.3.0
[I 2025-04-21 16:59:44.638 JupyterHub app:3384] Using Proxy: jupyterhub.proxy.ConfigurableHTTPProxy-5.3.0
   
[I 2025-04-21 16:59:44.987 JupyterHub proxy:477] Adding route for Hub: / => http://127.0.0.1:8081
16:59:44.988 [ConfigProxy] info: Adding route / -> http://127.0.0.1:8081
16:59:44.988 [ConfigProxy] info: Route added / -> http://127.0.0.1:8081
16:59:44.989 [ConfigProxy] info: 201 POST /api/routes/ 
[I 2025-04-21 16:59:44.989 JupyterHub app:3778] JupyterHub is now running at http://:8000

jupyterhub_config.py 생성

[jupyterhubapp@localhost ~]$ cd /etc/jupyterhub/
[jupyterhubapp@localhost jupyterhub]$ jupyterhub --generate-config
Writing default config to: jupyterhub_config.py
[jupyterhubapp@localhost jupyterhub]$ ls
jupyterhub_config.py

jupyterhub 사용자 계정 만들기

[bluesanta@localhost ~]$ sudo useradd -g jupyterhub -s /bin/bash -m user01
[bluesanta@localhost ~]$ sudo passwd user01
user01 사용자의 비밀 번호 변경 중
새 암호:
새 암호 재입력:
passwd: 모든 인증 토큰이 성공적으로 업데이트 되었습니다.

jupyterhub_config.py 파일 수정

[bluesanta@localhost ~]$ sudo vi /etc/jupyterhub/jupyterhub_config.py
c.JupyterHub.hub_connect_ip = '0.0.0.0'
c.JupyterHub.port = 8000

c.Authenticator.whitelist = set({'user01'})
c.Authenticator.allow_all = True

c.PAMAuthenticator.admin_users = set({'jupyterhubapp'})
# c.PAMAuthenticator.admin_groups = set({'jupyterhub'})

jupyterhub 서비스 등록

jupyterhub.service 파일 생성

[bluesanta@localhost ~]$ sudo vi /etc/systemd/system/jupyterhub.service
[Unit]
Description=JupyterHub
After=syslog.target network.target

[Service]
Type=simple
PIDFile=/run/jupyter.pid
User=root
WorkingDirectory=/etc/jupyterhub
ExecStart=/usr/local/bin/jupyterhub -f /etc/jupyterhub/jupyterhub_config.py

[Install]
WantedBy=multi-user.target

jupyterhub 서비스 등록

[bluesanta@localhost ~]$ sudo systemctl enable jupyterhub.service 
Created symlink /etc/systemd/system/multi-user.target.wants/jupyterhub.service → /etc/systemd/system/jupyterhub.service.

jupyterhub 서비스 갱신

[bluesanta@localhost ~]$ sudo systemctl daemon-reload

8000 포트 개방

[bluesanta@localhost ~]$ sudo firewall-cmd --permanent --zone=public --add-port=8000/tcp
success
[bluesanta@localhost ~]$ sudo firewall-cmd --reload
success
728x90

+ Recent posts