HPC NTCU
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Help
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    1
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Ubuntu 安裝 Slurm (使用 apt) ## apt 安裝 Slurm package (所有節點) ```bash= sudo apt update -y && sudo apt upgrade -y sudo apt install -y slurm-wlm slurm-wlm-doc ``` ## 建立設定檔 (所有節點) 以下設定檔都放在 /etc/slurm 底下 - Ubuntu 版本不同,有可能路徑稍微有差異 - 有的版本是 /etc/slurm,有的版本是 /etc/slurm-wlm - 可以用以下指令確定確切路徑 ```bash ls /etc | grep slurm ``` 以下的所有設定檔,所有的節點上都要有一份,且必須完全相同 ### cgroup.conf ``` CgroupAutomount=yes ConstrainCores=no ConstrainRAMSpace=no ``` 或是參考 [官方範例](https://github.com/SchedMD/slurm/blob/master/etc/cgroup.conf.example) 做更多設定 ### slurm.conf 不同的 Slurm 版本,支援的欄位不相同,建議使用自帶的設定檔產生器製作設定檔 #### 查詢安裝位置 用以下指令查詢產生器所在的位置 ```bash dpkg -L slurm-wlm-doc | grep html ``` - 應該可以獲得類似輸出 ``` $ dpkg -L slurm-wlm-doc | grep html /usr/share/doc/slurm-wlm/html /usr/share/doc/slurm-wlm/html/Slurm_Entity.pdf /usr/share/doc/slurm-wlm/html/Slurm_Individual.pdf ... ``` 以上面的輸出為例,產生器在 */usr/share/doc/slurm-wlm/html* 底下;由於產生器是 html 寫的,需要透過瀏覽器使用,這邊建議直接在該目錄啟動一個 http server - 可以用 python 自帶的 http server ```bash cd /usr/share/doc/slurm-wlm/html # 替換成你查到的路徑 python -m http.server ``` - 打開瀏覽器,瀏覽該機器的 port 8000 - http://your-host:8000 - your-host 換成裝 slurm 的機器的 IP、hostname... - 在打開的頁面中找到 *configurator.html* ![image](https://hackmd.io/_uploads/rJ9PRUj_R.png) - 填入必要的欄位 ![image](https://hackmd.io/_uploads/ryHKRLs_0.png) - Control Machines: SlurmctldHost 填入 Control node 的 hostname ![image](https://hackmd.io/_uploads/Hyp60IsdA.png) - Compute Machines: NodeName 填入 Compute node 的 hostname,可用 [A-B] 表示 A, A+1, A+2, ..., B ![image](https://hackmd.io/_uploads/H1z7kwi_C.png) - Compute Machines: CPU 填入每個 Compute node 的 CPU 核心數量 ![image](https://hackmd.io/_uploads/B16N1ws_C.png) - State Preservation - StateSaveLocation 改成 /var/spool/slurm - SlurmdSpoolDir 改成 /var/spool/slurm/slurmd ![image](https://hackmd.io/_uploads/rJP_Wvjd0.png) - Event Logging - SlurmctldLogFile 改 /var/spool/slurm/log/slurmctld.log - SlurmdLogFile 改 /var/spool/slurm/log/slurmd.log - 這邊目的是讓 log 和上面的 state preservation 放在同個目錄下就不用改太多權限 ![image](https://hackmd.io/_uploads/rydEMAGrgl.png) :::warning - State Preservation 的兩個路徑可以改成其他路徑,或是按照預設值 - 但是後面調整目錄權限時,需要確定自己調整的目錄是對的 ::: - 完成設定後,按下頁面最下方的 submit,此頁面就會變成 Slurm 設定檔 ![image](https://hackmd.io/_uploads/Sy7gGPjO0.png) - 全選並複製所有內容 ![image](https://hackmd.io/_uploads/HkcWGPiOC.png) - 在 /etc/slurm/slurm.conf 貼上剛剛複製的內容 ## 設定目錄與權限設定 在 /var/spool 底下建立 slurm 目錄,並將所有權改成 slurm:slurm ``` sudo mkdir -p /var/spool/slurm/log sudo chown slurm:slurm /var/spool/slurm sudo chown slurm:slurm /var/spool/slurm/log ``` ## 設定 munge key (多節點) munge key 的路徑是 */etc/munge/munge.key*,將這個檔案複製到所有節點上 (並放在每個節點的 /etc/munge 中) - 用 scp (或其他方法) 將 key 複製到其他節點,這邊放到另一個節點的 ~ ``` sudo scp /etc/munge/munge.key USER@HOST:~/ ``` - 登入到其他節點上,將 key 移動到 /etc/munge 底下 ``` sudo mv ~/munge.key /etc/munge ``` - 修改權限,以符合安全要求 ``` sudo chmod 400 /etc/munge/munge.key sudo chown munge:munge /etc/munge/munge.key ``` - 重啟 munge 以載入新的 key ``` sudo systemctl restart munge ``` ## 啟動 Slurm - control node ``` sudo systemctl start slurmctld ``` - compute node ``` sudo systemctl start slurmd ``` 確認是否啟動成功 ``` # 列出所有節點資訊 sinfo ```

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully