RZ-Huang
    • Create new note
    • Create a note from template
      • 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
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me 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 New
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
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
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me 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
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # 網路基礎應用概論 ###### tags: `network`、`application`、`note` ## ISP Internet Service Provider,網路連線服務提供商,簡單講在台灣最大宗就是中華電信。 #### 延伸資料 1. https://zh.wikipedia.org/wiki/%E4%BA%92%E8%81%94%E7%BD%91%E6%9C%8D%E5%8A%A1%E4%BE%9B%E5%BA%94%E5%95%86 ## VPS Virtual Private Server,虛擬專用伺服器,底層是在一個實體的伺服器當中,利用特有的技術,建造出每個獨立的虛擬伺服器,虛擬伺服器彼此之間互不干涉。可以向提供 VPS Service 的供應商租賃 VPS 來做使用,有相當多的優點(包括安全),詳情請見參考資料[1]。 #### 參考資料 1. [VPS託管A-to-Z指南:如何工作,如何選擇和最佳VPS優惠](https://www.webhostingsecretrevealed.net/zh-TW/vps-hosting-guide/) 2. [架站用VPS還是Web Hosting,中文翻譯都有「虛擬」到底差在哪?](https://progressbar.tw/posts/102) ## 伺服器 伺服器就是一台電腦,只是有裝伺服器的程式 分三種類型: 1. 虛擬空間: 和別人租,只有上傳檔案的空間,沒有操控權。 2. 虛擬主機: 一台實體主機上面有很多虛擬主機,每台虛擬主機平分容量,可以視為 cloud,還有另外一個重點是,當今天實體主機壞掉,虛擬主機上面的資料可以轉移到其它的實體主機上,因此虛擬主機是比較常用的方式。 3. 實體主機: 自己有一台完整的主機,主機只能用來當作伺服器,不能做其它用途。 ## 如何操作伺服器? ### SSH(Secure Shell) 透過 command line 介面直接連到遠端的主機下達指令。 ### 遠端桌面 也可以透過遠端桌面的方式(Windows 較常見)。 ## 伺服器的網路架構 ### NAT (Network Address Translation) 透過 NAT 讓內網與外網做一個區隔,利用 NAT 把內網裡面的資料傳到外網來;外網傳資料也只能傳到 NAT,NAT 再把資料分配給內網。因此外網不會知道內網的狀況;內網彼此之間可以互相溝通。 ### Load Balancer 當伺服器同時有許多人要進入時(比如搶票、搶購),我們可以加購 Server 來負擔流量,可是我們要怎麼把進來的 request 平均分散並且判定哪個 Server 是低負載的呢? 這時就可以使用 Load Balancer 來平均分配,得知每一台的 Server 的負載情況,進而有效分配流量,可是還會遇到另外一個問題就是,使用者使用 Server 1 登入進來的,可是在下一個時刻 Server 1 是高負載的情況,如果同一位使用者又發出了一些請求動作,那麼 Load Balancer 就會調配這個流量到其它的 Server 去,可是 **只有 Server 1 會有這個使用者的 Session ID**,這時該怎麼辦? 因此就有個「共有Session」的機制來解決這個問題,這又是另外一個故事了。 #### 參考資料: [大架構的概念與程式設計--(三)Load Balance(又叫分流、負載平衝)設計](http://akuma1.pixnet.net/blog/post/168326978-%E5%A4%A7%E6%9E%B6%E6%A7%8B%E7%9A%84%E6%A6%82%E5%BF%B5%E8%88%87%E7%A8%8B%E5%BC%8F%E8%A8%AD%E8%A8%88%EF%BC%8D%EF%BC%8D%EF%BC%88%E4%B8%89%EF%BC%89load-balance) ### 資料庫 Replication 簡單說就是 Master 的資料庫(主機)的資料同步 MySQL Replication(備份)到 Slave 的資料庫(備用機)可能不只一台。然後「讀取資料所用的資料庫」與「輸入資料後傳送到的目的資料庫」會分開來,比如 Master 負責 write 的資料;Slave 負責 read 的資料,這樣 Master 的資料庫就不會負擔這麼大。 ![Database Replication](https://i.imgur.com/ntpqMPq.png) ### 資料庫高可用性 High Availability 簡單說就是 Master 的資料庫掛掉,可以有 Slave 的資料庫前來代替。 ![High Availability](https://i.imgur.com/ijLde51.png) #### 參考資料: [PostgreSQL Database Replication](https://www.vertabelo.com/blog/technical-articles/postgresql-database-replication) ## 網域供應商 * [Godaddy](https://tw.godaddy.com/offers/domains/godaddy-b?isc=gofktw06&countryview=1&currencyType=TWD&gclid=Cj0KCQjwvdXpBRCoARIsAMJSKqJW6d-QuyVUII6uRm2JJ6lsb59tkHYEqVSk7m3SWvubsbgGOLqGwZ4aAjlREALw_wcB&gclsrc=aw.ds) * [gandi](https://www.gandi.net/zh-hant) ## 伺服器供應商 * [Digital ocean](https://www.digitalocean.com/products/kubernetes/?_campaign=K8S_Dev_Awareness_G_Search_B_Core&_adgroup=Core_DigitalOcean&_keyword=digital%20ocean&_device=c&_copytype=k8sPrice&_adposition=1t1&_medium=brand_sem&_source=google&_dkitrig=&_2dkitrig=&gclid=Cj0KCQjwvdXpBRCoARIsAMJSKqL-bDk8ekZ-s_KS4FnxQLK5ZMN9yOQXgk2ZHst7zV8unnRd5xf5JPoaAperEALw_wcB) * [AWS](https://aws.amazon.com/tw/)

    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